lib: use BUGBITE_CONFIG_DIR instead of BUGBITE_CONFIG for config over… #1054
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: lint | |
on: | |
push: | |
branches: ['**'] | |
paths: | |
- "**/*.rs" | |
- ".github/workflows/lint.yml" | |
pull_request: | |
branches: [main] | |
paths: "**/*.rs" | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
id: rust | |
with: | |
components: clippy, rustfmt | |
- name: Restore cache | |
uses: actions/cache/restore@v4 | |
id: restore-cache | |
with: | |
path: | | |
~/.cargo/bin | |
~/.cargo/registry/index | |
~/.cargo/registry/cache | |
~/.cargo/git/db | |
target | |
key: ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-rust-${{ steps.rust.outputs.cachekey }}-cargo-${{ hashFiles('Cargo.lock') }} | |
- name: Remove old caches | |
if: ${{ github.ref_name == 'main' && steps.restore-cache.outputs.cache-hit != 'true' }} | |
continue-on-error: true | |
run: | | |
gh extension install actions/gh-actions-cache | |
REPO=${{ github.repository }} | |
BRANCH=${{ github.ref }} | |
KEY=${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-rust- | |
# find matching caches | |
mapfile -t cache_keys < <( gh actions-cache list -R $REPO -B $BRANCH --key $KEY | cut -f 1 ) | |
# remove all matching caches | |
for key in ${cache_keys[@]} | |
do | |
gh actions-cache delete $key -R $REPO -B $BRANCH --confirm | |
done | |
exit 0 | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run rustfmt | |
run: cargo fmt --check | |
- name: Run clippy | |
run: cargo clippy --all-features --all-targets | |
- name: Save cache | |
if: ${{ github.ref_name == 'main' && steps.restore-cache.outputs.cache-hit != 'true' }} | |
uses: actions/cache/save@v4 | |
with: | |
path: | | |
~/.cargo/bin | |
~/.cargo/registry/index | |
~/.cargo/registry/cache | |
~/.cargo/git/db | |
target | |
key: ${{ steps.restore-cache.outputs.cache-primary-key }} |