mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-08-28 05:27:41 +00:00
Optimize CI for self-hosted runners and make macOS tests on-demand only
Remove rust-toolchain/rust-cache setup (pre-installed on self-hosted), disable checkout clean, enable sccache and incremental compilation. Split macOS tests into a separate job that only runs on workflow_dispatch since release.yml already gates on macOS tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
aad4cb61c0
commit
a4eb6fce06
1 changed files with 27 additions and 14 deletions
41
.github/workflows/rust.yml
vendored
41
.github/workflows/rust.yml
vendored
|
|
@ -39,32 +39,45 @@ jobs:
|
|||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
|
||||
with:
|
||||
components: rustfmt
|
||||
clean: false
|
||||
- run: cargo fmt --check --all
|
||||
|
||||
clippy:
|
||||
name: Clippy
|
||||
runs-on: self-hosted
|
||||
env:
|
||||
RUSTC_WRAPPER: sccache
|
||||
SCCACHE_DIR: /home/bhelmkamp/.cache/sccache
|
||||
CARGO_INCREMENTAL: "1"
|
||||
steps:
|
||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
|
||||
with:
|
||||
components: clippy
|
||||
- uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
|
||||
with:
|
||||
cache-on-failure: true
|
||||
clean: false
|
||||
- run: cargo clippy --workspace -- -D warnings
|
||||
- name: Show sccache stats
|
||||
run: sccache --show-stats
|
||||
|
||||
test:
|
||||
name: Test (${{ matrix.os }})
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [self-hosted, macos-15]
|
||||
name: Test (Linux)
|
||||
runs-on: self-hosted
|
||||
env:
|
||||
RUSTC_WRAPPER: sccache
|
||||
SCCACHE_DIR: /home/bhelmkamp/.cache/sccache
|
||||
CARGO_INCREMENTAL: "1"
|
||||
steps:
|
||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
clean: false
|
||||
- run: cargo test --workspace
|
||||
- name: Show sccache stats
|
||||
run: sccache --show-stats
|
||||
|
||||
test-macos:
|
||||
name: Test (macOS)
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
runs-on: macos-15
|
||||
steps:
|
||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
with:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue