Fix cache concurrency issue #545
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: CI | |
on: | |
pull_request: | |
push: # required for actions/cache to work | |
branches: | |
- master | |
jobs: | |
compile: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
libfuse: [libfuse-dev, libfuse3-dev] | |
features: [ '', 'abi-7-19' ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache | |
id: rust-cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
~/.rustup/toolchains/ | |
target/ | |
key: ${{ runner.os }}-cargo-compile-v1-${{ matrix.libfuse }}-${{ matrix.features }}-${{ hashFiles('**/Cargo.toml', '.github/workflows/*.yml') }} | |
- name: Install packages | |
run: | | |
sudo apt update | |
sudo apt install -y ${{ matrix.libfuse }} build-essential | |
- name: Install Rust | |
if: steps.rust-cache.outputs.cache-hit != 'true' | |
run: | | |
rustup target add x86_64-unknown-linux-musl | |
- name: Run tests | |
run: | | |
cargo build --all --all-targets --features=${{ matrix.features }} | |
cargo build --all --all-targets --no-default-features | |
cargo build --target=x86_64-unknown-linux-musl --no-default-features | |
cargo test --all --features=${{ matrix.features }} | |
cargo doc --all --no-deps --features=${{ matrix.features }} | |
ci: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache | |
id: rust-cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
~/.rustup/toolchains/ | |
target/ | |
key: ${{ runner.os }}-cargo-ci-v1-${{ hashFiles('**/Cargo.toml', '.github/workflows/*.yml') }} | |
- name: Install packages | |
run: | | |
sudo apt update | |
sudo apt install -y libfuse-dev libfuse3-dev build-essential | |
- name: Install Rust | |
if: steps.rust-cache.outputs.cache-hit != 'true' | |
run: | | |
rustup toolchain install 1.81 | |
rustup component add rustfmt | |
rustup component add clippy | |
- name: Install cargo-deny | |
if: steps.rust-cache.outputs.cache-hit != 'true' | |
run: cargo +1.81 install --force --version 0.16.2 cargo-deny --locked | |
- name: Run tests | |
run: INTERACTIVE="" make pre | |
test: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
test_group: [mount_tests, pjdfs_tests, xfstests] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run tests | |
run: INTERACTIVE="" make ${{ matrix.test_group }} |