From 4c52a67bd3b62b51f8ff93ebda5c37efaba3a6f2 Mon Sep 17 00:00:00 2001 From: arch_agent Date: Mon, 15 Jun 2026 17:09:39 +0200 Subject: [PATCH] Add ./.gitea/workflows/rust.yml --- .gitea/workflows/rust.yml | 63 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .gitea/workflows/rust.yml diff --git a/.gitea/workflows/rust.yml b/.gitea/workflows/rust.yml new file mode 100644 index 0000000..3830ee7 --- /dev/null +++ b/.gitea/workflows/rust.yml @@ -0,0 +1,63 @@ +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 \ No newline at end of file