54 lines
1.8 KiB
YAML
54 lines
1.8 KiB
YAML
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-24.04
|
|
steps:
|
|
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
|
- name: Setup Nix Environment
|
|
uses: ./.github/actions/setup-nix
|
|
with:
|
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
|
tools: style.lint.bin style.styleCheck.bin
|
|
- 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
|
|
|
|
commit:
|
|
if: github.event_name != 'push' # we don't run this on a push, a failure on push disrupts the release workflow
|
|
name: Commit
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
|
with:
|
|
fetch-depth: 100 # fetch history (last 100 commits) instead of default shallow clone history, this is deemed enough for a PR history
|
|
- name: Setup Nix Environment
|
|
uses: ./.github/actions/setup-nix
|
|
with:
|
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
|
tools: gitTools.commitCheck.bin
|
|
- name: Run commitlint (check locally with `nix-shell --run postgrest-commitlint`)
|
|
run: |
|
|
# Fetch target branch explicitly
|
|
git fetch origin ${{ github.base_ref }}
|
|
|
|
# Run commitlint
|
|
postgrest-commitlint --from origin/${{ github.base_ref }} --to HEAD
|