Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Rust Cache invalid key warning #59

Merged
merged 10 commits into from
Oct 14, 2022
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,17 @@ jobs:
# https://github.com/actions/runner/issues/409#issuecomment-752775072
components: ${{ contains(matrix.channel, 'nightly') && 'miri' || '' }}

# The features string contains commas which cannot be part of the cache
# key for the Rust Cache action. Instead, we hash the features
# to get a string of legal characters.
- name: Set feature string for cache key
run: |
echo "FEATURES_HASH=$(echo ${{ matrix.features }} | sha256sum | cut -d ' ' -f 1)" >> $GITHUB_ENV
joshlf marked this conversation as resolved.
Show resolved Hide resolved

- name: Rust Cache
uses: Swatinem/rust-cache@v2.0.0
with:
key: "${{ matrix.channel }}-${{ matrix.target }}-${{ matrix.features }}-${{ hashFiles('**/Cargo.lock') }}"
key: "${{ matrix.channel }}-${{ matrix.target }}-${{ env.FEATURES_HASH }}-${{ hashFiles('**/Cargo.lock') }}"

- name: Check
run: cargo +${{ matrix.channel }} check --target ${{ matrix.target }} --features "${{ matrix.features }}" --verbose
Expand Down