Skip to content

Commit 42e27aa

Browse files
authored
add CI job for branch protection (#9)
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
1 parent c9d2401 commit 42e27aa

2 files changed

Lines changed: 27 additions & 5 deletions

File tree

.github/workflows/ValidatePullRequests.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,45 @@ on:
66
pull_request:
77
branches: [ main, 'release/**' ]
88

9+
# Cancels old running job if a new one is triggered (e.g. by a push onto the same branch).
10+
# This will cancel dependent jobs as well, such as dep_build and dep_benchmarks
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
915
permissions:
1016
id-token: write
1117
contents: read
1218

1319
jobs:
20+
spelling:
21+
name: Spell check with typos
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v5
25+
- name: Spell Check Repo
26+
uses: crate-ci/typos@v1.38.1
27+
1428
build:
1529
uses: ./.github/workflows/dep_build.yml
1630
secrets: inherit
31+
1732
benchmarks:
1833
uses: ./.github/workflows/dep_benchmarks.yml
1934
secrets: inherit
2035
with:
2136
download-benchmarks: true
2237
upload-benchmarks: false
2338

39+
# Gate PR merges on this specific "join-job" which requires all other
40+
# jobs to run first.
41+
report-ci-status:
42+
needs:
43+
- build
44+
- benchmarks
45+
- spelling
46+
if: always()
47+
runs-on: ubuntu-latest
48+
steps:
49+
- name: calculate the correct exit status
50+
run: jq --exit-status 'all(.result == "success" or .result == "skipped")' <<< '${{ toJson(needs) }}'

.github/workflows/dep_build.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,6 @@ jobs:
7474
run: |
7575
just build-js-host-api ${{ matrix.config }}
7676
77-
- name: Spell Check Repo
78-
# Only run on linux, otherwise we need to install wget on windows...
79-
if: runner.os == 'Linux'
80-
uses: crate-ci/typos@master
81-
8277
- name: lint
8378
run: just lint ${{ matrix.config }}
8479

0 commit comments

Comments
 (0)