Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/build-check-features-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Build Check Features Cache

permissions:
contents: read
actions: write

on:
workflow_dispatch:
push:
branches:
- "main"
paths:
- "src/**"
- "Cargo.toml"
- "Cargo.lock"
- "rust-toolchain.toml"
- "tests/fixtures/**"
- "static/**"
- ".sqlx/**"

env:
CACHE_CHECK_KEY: check-features-release
CACHE_PATH: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/

jobs:
build_check_features_cache:
name: Build Check Features cache
runs-on: stratus-runner
timeout-minutes: 45

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true

steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1

- name: Set up Rust
run: rustup show

- name: Rust Cache - Restore check-features cache
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ${{ env.CACHE_PATH }}
key: ${{ env.CACHE_CHECK_KEY }}-${{ runner.os }}--${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ env.CACHE_CHECK_KEY }}-${{ runner.os }}--

- name: Install libsasl2-dev libssl-dev
run: sudo apt-get update && sudo apt install -y build-essential pkg-config libssl-dev libsasl2-dev

- name: Set up dependencies
uses: taiki-e/install-action@cfdb446e391c69574ebc316dfb7d7849ec12b940 # v2.68.8
with:
tool: cargo-hack@0.6.39

- name: Set up Just
uses: extractions/setup-just@dd310ad5a97d8e7b41793f8ef055398d51ad4de6 # v2

- name: Prime check-features cache
# Runs the exact same command (`just check-features`) with the same env as the
# PR check-features job, so the `.rmeta` fingerprints produced here are reused
# on cache restore. No coverage flags in either side, so RUSTFLAGS matches by
# inheritance — do not override it here, that would diverge from the consumer.
run: just check-features
env:
CARGO_PROFILE_RELEASE_DEBUG: 0
RUST_LOG: error
RELEASE: 1

- name: Rust Cache - Save check-features cache
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ${{ env.CACHE_PATH }}
key: ${{ env.CACHE_CHECK_KEY }}-${{ runner.os }}--${{ hashFiles('**/Cargo.lock') }}
12 changes: 11 additions & 1 deletion .github/workflows/build-debug-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Set up dependencies
uses: taiki-e/install-action@cfdb446e391c69574ebc316dfb7d7849ec12b940 # v2.68.8
with:
tool: cargo-llvm-cov@0.6.14
tool: cargo-llvm-cov@0.6.14 cargo-hack@0.6.39
Comment thread
carneiro-cw marked this conversation as resolved.

- name: Build Debug binaries for cache
# Prime the cache with exactly what consumers need:
Expand All @@ -68,6 +68,16 @@ jobs:
cargo test --no-run
cargo build --features dev

- name: Check all features
# Prime the cache with `.rmeta` artifacts for every feature combination the
# check-features job tests (`cargo hack check --each-feature`), so all 11 runs
# hit Fresh on PRs instead of rechecking ~450 crates per combo. Run WITHOUT
# coverage flags — check-features doesn't use them, and RUSTFLAGS is part of the
# fingerprint, so mismatched flags would force a full recheck.
env:
RUSTFLAGS: ""
run: cargo hack check --each-feature --keep-going
Comment thread
carneiro-cw marked this conversation as resolved.

- name: Rust Cache - Save shared key
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/check-features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
workflow_dispatch:

env:
CACHE_SHARED_KEY: stable-release
CACHE_CHECK_KEY: check-features-release
CACHE_PATH: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
Expand All @@ -47,12 +47,12 @@ jobs:
- name: Set up Rust
run: rustup show

- name: Rust Cache - Restore shared key
- name: Rust Cache - Restore check-features cache
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ${{ env.CACHE_PATH }}
restore-keys: ${{ env.CACHE_SHARED_KEY }}
key: ${{ env.CACHE_SHARED_KEY }}
key: ${{ env.CACHE_CHECK_KEY }}-${{ runner.os }}--${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ env.CACHE_CHECK_KEY }}-${{ runner.os }}--

- name: Install libsasl2-dev libssl-dev
run: sudo apt-get update && sudo apt install -y build-essential pkg-config libssl-dev libsasl2-dev
Expand Down
Loading