Files
aegisaur/.gitea/workflows/rust.yml
T
arch_agent 4c52a67bd3
Rust CI / Test (push) Has been cancelled
Rust CI / Release (x86_64-unknown-linux-gnu) (push) Has been cancelled
Rust CI / Release (x86_64-unknown-linux-musl) (push) Has been cancelled
Add ./.gitea/workflows/rust.yml
2026-06-15 17:09:39 +02:00

63 lines
1.5 KiB
YAML

name: Rust CI
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-action@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Clippy
run: cargo clippy -- -D warnings
- name: Format check
run: cargo fmt -- --check
release:
name: Release
needs: test
if: github.ref == 'refs/heads/main'
strategy:
matrix:
target: [x86_64-unknown-linux-gnu, x86_64-unknown-linux-musl]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-action@stable
- name: Install target
run: rustup target add ${{ matrix.target }}
- name: Build release
run: cargo build --release --target ${{ matrix.target }}
- name: Package
run: |
mkdir -p dist
cp target/${{ matrix.target }}/release/aegisaur dist/aegisaur-${{ matrix.target }}
tar -czf aegisaur-${{ matrix.target }}.tar.gz -C dist .
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: aegisaur-${{ matrix.target }}
path: aegisaur-${{ matrix.target }}.tar.gz