name: Development CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
types: [ opened, synchronize, reopened ]
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test & Lint
runs-on: self-hosted
defaults:
run:
working-directory: ./api-runtime
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache cargo dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
api-runtime/target
key: ${{ runner.os }}-cargo-${{ hashFiles('api-runtime/Cargo.lock') }}
- name: Check formatting
run: cargo fmt -- --check
- name: Run clippy
run: cargo clippy -- -W clippy::all
- name: Run tests
run: cargo test --verbose || true
- name: Build debug
run: cargo build --verbose
build-linux:
name: Build Linux
needs: test
runs-on: self-hosted
defaults:
run:
working-directory: ./api-runtime
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
api-runtime/target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('api-runtime/Cargo.lock') }}
- name: Build release
run: cargo build --release --verbose
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: mrapids-linux
path: api-runtime/target/release/mrapids