mirror of
https://github.com/redstrate/Physis.git
synced 2025-04-19 17:36:50 +00:00
66 lines
1.6 KiB
YAML
66 lines
1.6 KiB
YAML
name: Main
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
reuse:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: REUSE Compliance Check
|
|
uses: fsfe/reuse-action@v3
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/cache@v4
|
|
id: cache-deps
|
|
with:
|
|
path: |
|
|
~/.cargo/bin/
|
|
~/.cargo/registry/index/
|
|
~/.cargo/registry/cache/
|
|
~/.cargo/git/db/
|
|
target/
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install \
|
|
libunshield-dev \
|
|
- name: Install Cargo dependencies
|
|
if: steps.cache-deps.outputs.cache-hit != 'true'
|
|
run: |
|
|
cargo install --locked cargo-deny
|
|
cargo install --locked cargo-semver-checks
|
|
- name: Build
|
|
run: cargo build --verbose
|
|
- name: Run tests
|
|
run: cargo test --verbose
|
|
- name: Run clippy
|
|
run: cargo clippy
|
|
- name: Set up SSH key
|
|
if: github.ref == 'refs/heads/main'
|
|
run: |
|
|
mkdir -p ~/.ssh
|
|
echo "${{ secrets.DEPLOY_PRIVATE_KEY }}" > ~/.ssh/id_rsa
|
|
chmod 600 ~/.ssh/id_rsa
|
|
- name: Update Docs
|
|
if: github.ref == 'refs/heads/main'
|
|
run: |
|
|
cargo doc --release --no-deps
|
|
rsync -e "ssh -p 38901 -o StrictHostKeyChecking=no" --recursive target/doc/ deploy@ryne.moe:/srv/http/physis-docs
|
|
- name: Run deny-check
|
|
run: |
|
|
cargo deny check
|
|
- name: Run semver-checks
|
|
run: |
|
|
cargo semver-checks check-release
|