Skip to content

rework(bugzilla): replace tar command usage for attachment creation w… #1116

rework(bugzilla): replace tar command usage for attachment creation w…

rework(bugzilla): replace tar command usage for attachment creation w… #1116

Workflow file for this run

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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Set up rust toolchain
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 #stable
id: rust
with:
components: clippy, rustfmt
- name: Restore cache
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae #v5.0.5
id: restore-cache
with:
path: |
~/.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@27d5ce7f107fe9357f9df03efb73ab90386fccae #v5.0.5
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
target
key: ${{ steps.restore-cache.outputs.cache-primary-key }}