Open 9SMTM6 opened 9 months ago
here is the job for clippy, worked up to chapter 7:
# `clippy` container job
clippy:
name: Clippy
runs-on: ubuntu-latest
container: ghcr.io/catthehacker/ubuntu:act-latest
env:
SQLX_OFFLINE: true
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
with:
key: sqlx-${{ env.SQLX_VERSION }}
- name: Linting
run: cargo clippy -- -D warnings
The clippy job, unless I missed something or did not get there yet, (currently chapter 7) doesn't require to use a live database. So it can be shortend (importantly also in execution time and resource usage) by removing everything but the checkout, the cache and then the linting task.
Its generally somewhat annoying to me how many tasks are repeated between the different jobs, but admittedly I also cant find an approach that does this better without tradeoffs (such as doing them only as steps in one task, or committing some image to an image repository, which requires more buy in into some container image repository such as github, and might leave behind a lot of garbage).