steps:
- name: checkout
uses: actions/checkout@v2
+ - name: Generate cache key
+ run: echo "${{ matrix.rust }} ${{ matrix.features }}" | tee .cache_key
- name: cache
uses: actions/cache@v2
with:
~/.cargo/registry
~/.cargo/git
target
- key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
+ key: ${{ runner.os }}-cargo-${{ hashFiles('.cache_key') }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- name: Set default toolchain
run: rustup default ${{ matrix.rust }}
- name: Set profile
~/.cargo/registry
~/.cargo/git
target
- key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
+ key: ${{ runner.os }}-cargo-${{ github.job }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- name: Install rustup
run: curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: Set default toolchain
~/.cargo/registry
~/.cargo/git
target
- key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
+ key: ${{ runner.os }}-cargo-${{ github.job }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
# Install a recent version of clang that supports wasm32
- run: wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - || exit 1
- run: sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-10 main" || exit 1
- name: Add clippy
run: rustup component add rustfmt
- name: Check fmt
- run: cargo fmt --all -- --check
\ No newline at end of file
+ run: cargo fmt --all -- --check