cache artifacts and remove duplicate build step #110
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: Build and Test | |
on: | |
push: | |
env: | |
CARGO_TERM_COLOR: always | |
CARGO_NET_RETRY: 10 | |
RUSTC_WRAPPER: sccache | |
RUST_BACKTRACE: 1 | |
# Enable parallel compilation | |
RUSTC_PARALLEL_COMPILER: true | |
jobs: | |
build: | |
name: Build and Test | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-14, macos-latest, windows-latest] | |
include: | |
- os: macos-14 | |
name: 'macOS ARM' | |
- os: macos-latest | |
name: 'macOS x86' | |
- os: windows-latest | |
name: 'Windows' | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
# Install and setup sccache | |
- name: Install sccache | |
uses: mozilla-actions/[email protected] | |
# Setup Rust toolchain with caching | |
- name: Setup Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
# Cache dependencies and build outputs | |
- name: Cache cargo registry | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo- | |
- name: Run tests | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --release -- --test-threads num_cpus |