ci: update PR ci to only run one "task" with all jobs and not two "ta… #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check branch changes | |
on: | |
push: | |
branches: | |
- main | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
backend_lint: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./rust/api-server | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Rust setup | |
run: rustup toolchain install stable --profile minimal | |
- name: Lint | |
run: cargo fmt --check | |
backend_build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./rust/api-server | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Rust setup | |
run: rustup toolchain install stable --profile minimal | |
- name: Cache Cargo build target | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
rust/api-server/target | |
key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.lock') }} | |
- name: Build | |
run: cargo build --release --bin bitcraft-hub-api |