Skip to content

Commit c74b006

Browse files
authored
chore: configure merge queues (#867)
1 parent acb98e2 commit c74b006

File tree

4 files changed

+121
-109
lines changed

4 files changed

+121
-109
lines changed

.github/workflows/ci.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
merge_group:
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
verifications:
13+
name: Verifications
14+
uses: ./.github/workflows/verifications.yml
15+
16+
required-checks:
17+
name: Require CI status checks
18+
runs-on: ubuntu-latest
19+
if: ${{ !cancelled() && github.event.action != 'closed' }}
20+
needs: [verifications]
21+
steps:
22+
- run: ${{ !contains(needs.*.result, 'failure') }}
23+
- run: ${{ !contains(needs.*.result, 'cancelled') }}

.github/workflows/pipeline.yml

-109
This file was deleted.

.github/workflows/release.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
# semantic-release valid branches
7+
- '+([0-9])?(.{+([0-9]),x}).x'
8+
- 'main'
9+
- 'next'
10+
- 'next-major'
11+
- 'beta'
12+
- 'alpha'
13+
14+
concurrency:
15+
group: release
16+
cancel-in-progress: false
17+
18+
jobs:
19+
publish:
20+
name: Publish NPM package
21+
runs-on: ubuntu-latest
22+
# Avoid publishing in forks
23+
if: github.repository == 'testing-library/eslint-plugin-testing-library'
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Set up Node
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version-file: '.nvmrc'
32+
33+
- name: Install dependencies
34+
uses: bahmutov/npm-install@v1
35+
36+
- name: Build package
37+
run: npm run build
38+
39+
- name: Release new version
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
NPM_TOKEN: ${{ secrets.NPM_AUTOMATION_TOKEN }}
43+
run: npx semantic-release

.github/workflows/verifications.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Verifications
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
code-validation:
8+
name: 'Code Validation: ${{ matrix.validation-script }}'
9+
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
validation-script:
14+
['lint', 'type-check', 'format:check', 'generate-all:check']
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Node
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version-file: '.nvmrc'
23+
24+
- name: Install dependencies
25+
uses: bahmutov/npm-install@v1
26+
27+
- name: Run script
28+
run: npm run ${{ matrix.validation-script }}
29+
30+
tests:
31+
name: Tests (Node v${{ matrix.node }} - ESLint v${{ matrix.eslint }})
32+
runs-on: ubuntu-latest
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
# The .x indicates "the most recent one"
37+
node: [19.x, 18.x, 17.x, 16.x, 14.x, 14.17.0, 12.x, 12.22.0]
38+
eslint: [7.5, 7, 8]
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v4
42+
43+
- name: Set up Node
44+
uses: actions/setup-node@v4
45+
with:
46+
node-version: ${{ matrix.node }}
47+
48+
- name: Install dependencies
49+
uses: bahmutov/npm-install@v1
50+
51+
- name: Install ESLint v${{ matrix.eslint }}
52+
run: npm install --no-save --force eslint@${{ matrix.eslint }}
53+
54+
- name: Run tests
55+
run: npm run test:ci

0 commit comments

Comments
 (0)