ci: add linting to CI

This commit is contained in:
Jon Seager 2026-02-06 19:01:28 +00:00
parent 6431d97afa
commit 8a669f70d2
No known key found for this signature in database
2 changed files with 51 additions and 1 deletions

View file

@ -8,6 +8,30 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install nix
uses: DeterminateSystems/nix-installer-action@main
- name: Setup Nix cache
uses: nix-community/cache-nix-action@main
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
restore-prefixes-first-match: nix-${{ runner.os }}-
- name: Check formatting
run: nix develop -c cargo fmt --check
- name: Clippy
run: nix develop -c cargo clippy
test: test:
name: Run Tests name: Run Tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -33,7 +57,9 @@ jobs:
deploy: deploy:
name: Deploy to Fly.io name: Deploy to Fly.io
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [test] needs:
- lint
- test
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v6 uses: actions/checkout@v6

View file

@ -8,6 +8,30 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install nix
uses: DeterminateSystems/nix-installer-action@main
- name: Setup Nix cache
uses: nix-community/cache-nix-action@main
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
restore-prefixes-first-match: nix-${{ runner.os }}-
- name: Check formatting
run: nix develop -c cargo fmt --check
- name: Clippy
run: nix develop -c cargo clippy
test: test:
name: Run Tests name: Run Tests
runs-on: ubuntu-latest runs-on: ubuntu-latest