ci: consolidate Build and Lint workflows into single Check workflow
Consolidate the separate Build and Lint workflows into a unified Check workflow, as linting is now integrated into the build process. Link: https://github.com/danth/stylix/pull/519
This commit is contained in:
parent
6085560893
commit
0d0af5f442
2 changed files with 7 additions and 49 deletions
|
|
@ -1,4 +1,4 @@
|
|||
name: Build
|
||||
name: Check
|
||||
|
||||
on:
|
||||
push:
|
||||
|
|
@ -34,17 +34,17 @@ jobs:
|
|||
outputs:
|
||||
packages: ${{ steps.list-packages.outputs.packages }}
|
||||
|
||||
build:
|
||||
check:
|
||||
needs: evaluate
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build: ${{ fromJSON(needs.evaluate.outputs.packages) }}
|
||||
check: ${{ fromJSON(needs.evaluate.outputs.packages) }}
|
||||
|
||||
name: ${{ matrix.build.key }} on ${{ matrix.build.arch }}
|
||||
name: ${{ matrix.check.key }} on ${{ matrix.check.arch }}
|
||||
|
||||
runs-on: ${{ matrix.build.os }}
|
||||
runs-on: ${{ matrix.check.os }}
|
||||
|
||||
steps:
|
||||
- name: Install Nix
|
||||
|
|
@ -57,5 +57,5 @@ jobs:
|
|||
- name: Set up cache
|
||||
uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
|
||||
- name: Build ${{ matrix.build.key }}
|
||||
run: nix -L build github:${{ github.repository }}/${{ github.event.pull_request.head.sha || github.sha }}#${{ matrix.build.type }}.${{ matrix.build.arch }}.${{ matrix.build.key }} --no-update-lock-file
|
||||
- name: Check ${{ matrix.check.key }}
|
||||
run: nix -L check github:${{ github.repository }}/${{ github.event.pull_request.head.sha || github.sha }}#${{ matrix.check.type }}.${{ matrix.check.arch }}.${{ matrix.check.key }} --no-update-lock-file
|
||||
42
.github/workflows/lint.yml
vendored
42
.github/workflows/lint.yml
vendored
|
|
@ -1,42 +0,0 @@
|
|||
name: Lint
|
||||
|
||||
on: pull_request
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Install Nix
|
||||
uses: DeterminateSystems/nix-installer-action@main
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
extra-conf: |
|
||||
extra-experimental-features = nix-command flakes
|
||||
|
||||
- name: Set up cache
|
||||
uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
|
||||
- name: Install tools
|
||||
run: |
|
||||
flake='github:nixos/nixpkgs/e913ae340076bbb73d9f4d3d065c2bca7caafb16'
|
||||
nix profile install "${flake}#statix"
|
||||
nix profile install "${flake}#deadnix"
|
||||
nix profile install "${flake}#jq"
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Run statix
|
||||
run: |
|
||||
statix check --format json |\
|
||||
jq --raw-output '.file as $file | .report[] | .severity as $severity | .diagnostics[] | "::warning file=\($file),line=\(.at.from.line),col=\(.at.from.column)::\(.message)"'
|
||||
|
||||
- name: Run deadnix
|
||||
run: |
|
||||
deadnix --no-lambda-arg --output-format json |\
|
||||
jq --raw-output '.file as $file | .results[] | "::warning file=\($file),line=\(.line),col=\(.column)::\(.message)"'
|
||||
Loading…
Add table
Add a link
Reference in a new issue