forked from herocode/horus
83 lines
2.2 KiB
YAML
83 lines
2.2 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- '**'
|
|
pull_request:
|
|
types: [opened, synchronize, reopened]
|
|
|
|
jobs:
|
|
build-and-test:
|
|
name: Build & Test
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Rust toolchain
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
components: rustfmt, clippy
|
|
|
|
- name: Cache cargo registry
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.cargo/registry
|
|
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-registry-
|
|
|
|
- name: Cache cargo index
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.cargo/git
|
|
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-index-
|
|
|
|
- name: Cache cargo build
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: target
|
|
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-build-target-
|
|
|
|
- name: Check code
|
|
run: cargo check --workspace --verbose
|
|
|
|
- name: Run tests
|
|
run: cargo test --workspace --verbose
|
|
|
|
- name: Run clippy
|
|
run: cargo clippy --workspace -- -D warnings
|
|
|
|
- name: Check formatting
|
|
run: cargo fmt --all -- --check
|
|
|
|
- name: Build release binaries
|
|
run: cargo build --workspace --release --verbose
|
|
|
|
- name: List built binaries
|
|
run: |
|
|
echo "Built binaries:"
|
|
ls -lh target/release/ | grep -E '^-.*x.*'
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: binaries-${{ github.sha }}
|
|
path: |
|
|
target/release/supervisor
|
|
target/release/coordinator
|
|
target/release/horus
|
|
target/release/osiris
|
|
target/release/herorunner
|
|
target/release/runner_osiris
|
|
target/release/runner_sal
|
|
retention-days: 7
|
|
if-no-files-found: warn
|