Skip to content

Commit

Permalink
ci: Split Lint & Style from Test workflow
Browse files Browse the repository at this point in the history
The Lint & Style job needs to run on all PRs, not only when something "test" related
changes. Otherwise not all workflow, nix or other files are style-checked and linted.
  • Loading branch information
wolfgangwalther committed Feb 24, 2024
1 parent e6cde92 commit d6153be
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 16 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Check

on:
workflow_call:
secrets:
CACHIX_AUTH_TOKEN:
required: false
pull_request:
branches:
- main
- v[0-9]+

concurrency:
# Terminate all previous runs of the same workflow for pull requests
group: style-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
lint-style:
name: Lint & Style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Nix Environment
uses: ./.github/actions/setup-nix
with:
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
tools: style
- name: Run linter (check locally with `nix-shell --run postgrest-lint`)
run: postgrest-lint
- name: Run style check (auto-format with `nix-shell --run postgrest-style`)
run: postgrest-style-check
7 changes: 7 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ concurrency:
cancel-in-progress: true

jobs:
check:
name: Check
uses: ./.github/workflows/check.yaml
secrets:
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}


docs:
name: Docs
uses: ./.github/workflows/docs.yaml
Expand Down
16 changes: 0 additions & 16 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,6 @@ concurrency:
cancel-in-progress: true

jobs:
lint-style:
name: Lint & Style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Nix Environment
uses: ./.github/actions/setup-nix
with:
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
tools: style
- name: Run linter (check locally with `nix-shell --run postgrest-lint`)
run: postgrest-lint
- name: Run style check (auto-format with `nix-shell --run postgrest-style`)
run: postgrest-style-check


coverage:
name: Coverage
runs-on: ubuntu-latest
Expand Down

0 comments on commit d6153be

Please sign in to comment.