chore: ignore .sanctifier_cache #1
Workflow file for this run
This file contains hidden or 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: Rust CI | ||
|
Check failure on line 1 in .github/workflows/rust.yml
|
||
| on: | ||
| push: | ||
| branches: ["main"] | ||
| pull_request: | ||
| branches: ["main"] | ||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| jobs: | ||
| build-core-tooling-matrix: | ||
| name: Build Rust version matrix | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| versions: ${{ steps.versions.outputs.versions }} | ||
| steps: | ||
| - name: Install stable Rust toolchain | ||
| uses: dtolnay/rust-toolchain@stable | ||
| - name: Compute last 3 stable Rust versions | ||
| id: versions | ||
| shell: bash | ||
| run: | | ||
| stable="$(rustc --version --verbose | sed -n 's/^release: //p')" | ||
| major="${stable%%.*}" | ||
| remainder="${stable#${major}.}" | ||
| minor="${remainder%%.*}" | ||
| previous_one=$((minor - 1)) | ||
| previous_two=$((minor - 2)) | ||
| if (( previous_two < 0 )); then | ||
| echo "Unable to compute previous versions from stable release '${stable}'" >&2 | ||
| exit 1 | ||
| fi | ||
| versions="$(printf '["%s.%s","%s.%s","%s.%s"]' "$major" "$minor" "$major" "$previous_one" "$major" "$previous_two")" | ||
| echo "versions=${versions}" >> "$GITHUB_OUTPUT" | ||
| echo "Using Rust versions: ${versions}" | ||
| build-core-tooling-compat: | ||
| name: Build core tooling (Rust ${{ matrix.rust }}) | ||
| needs: build-core-tooling-matrix | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| rust: ${{ fromJson(needs.build-core-tooling-matrix.outputs.versions) }} | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| - name: Install Rust toolchain | ||
| uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| toolchain: ${{ matrix.rust }} | ||
| - name: Cache cargo registry & build artifacts | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.cargo/registry | ||
| ~/.cargo/git | ||
| target | ||
| key: ${{ runner.os }}-cargo-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-cargo-${{ matrix.rust }}- | ||
| ${{ runner.os }}-cargo- | ||
| - name: Build sanctifier-core and sanctifier-cli | ||
| run: cargo check -p sanctifier-core -p sanctifier-cli | ||
| build-and-test: | ||
| name: Build & Test sanctifier-cli | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| - name: Install stable Rust toolchain | ||
| uses: dtolnay/rust-toolchain@master | ||
| with: | ||
| toolchain: stable | ||
| components: rustfmt, clippy | ||
| - name: Cache cargo registry & build artifacts | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.cargo/registry | ||
| ~/.cargo/git | ||
| target | ||
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-cargo- | ||
| - name: Check formatting | ||
| run: cargo fmt --check | ||
| - name: Run Clippy | ||
| - name: Build release binary | ||
| run: cargo build --release --locked -p sanctifier-cli | ||