-
Notifications
You must be signed in to change notification settings - Fork 42
146 lines (127 loc) · 4.21 KB
/
validate.yml
File metadata and controls
146 lines (127 loc) · 4.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: validate
on:
push:
branches:
- "+([0-9])?(.{+([0-9]),x}).x"
- "main"
- "next"
- "next-major"
- "beta"
- "alpha"
- "!all-contributors/**"
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
main:
# ignore all-contributors PRs
if: ${{ !contains(github.head_ref, 'all-contributors') }}
strategy:
fail-fast: false
matrix:
eslint: [6, 7, 8, 9, 10]
node: [12.x, 14.x, 16.x, 18.x, 20.x, 21.x, 22.x, 24.x]
testing-library-dom: [8, 9, 10]
exclude:
- eslint: 9
node: 12.x
- eslint: 9
node: 14.x
- eslint: 9
node: 16.x
- eslint: 10
node: 12.x
- eslint: 10
node: 14.x
- eslint: 10
node: 16.x
- eslint: 10
node: 18.x
- eslint: 10
node: 21.x
- testing-library-dom: 9
node: 12.x
- testing-library-dom: 10
node: 12.x
- testing-library-dom: 10
node: 14.x
- testing-library-dom: 10
node: 16.x
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false
# see https://github.com/npm/cli/issues/7349
- if: ${{ matrix.eslint >= 9 }}
run: npm un @typescript-eslint/parser
- name: Install ESLint v${{ matrix.eslint }}
run: npm install --no-save --force eslint@${{ matrix.eslint }}
- name: Install @testing-library/dom v${{ matrix.testing-library-dom }}
run: npm install --no-save --force @testing-library/dom@${{ matrix.testing-library-dom }}
- name: Install TypeScript v4
if: ${{ matrix.node == '12.x' }}
run: npm install --no-save --force typescript@4
- name: ▶️ Run validate script (without linting)
if: ${{ matrix.eslint != 8 }}
run: npm run validate -- build,test:coverage
- name: ▶️ Run validate script (with linting)
if: ${{ matrix.eslint == 8 && matrix.node != '12.x' }}
run: npm run validate
- name: ▶️ Ensure docs are up-to-date
if: ${{ matrix.eslint == 8 && matrix.node != '12.x' }}
run: npm run lint:generate-readme-table
- name: ⬆️ Upload coverage report
uses: codecov/codecov-action@v3
release:
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for trusted publishing and npm provenance
needs: main
runs-on: ubuntu-latest
if: ${{ github.repository == 'testing-library/eslint-plugin-jest-dom' &&
contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/alpha',
github.ref) && github.event_name == 'push' }}
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version: 22
# todo: this can be removed once we are using a version of Node that
# ships with npm v11.5.1 or higher, which is needed for using oidc
- name: install latest npm
run: npm i -g npm
- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false
- name: 🏗 Run build script
run: npm run build
- run: ls -asl dist
- name: 🚀 Release
uses: cycjimmy/semantic-release-action@v4
with:
semantic_version: 25
branches: |
[
'+([0-9])?(.{+([0-9]),x}).x',
'main',
'next',
'next-major',
{name: 'beta', prerelease: true},
{name: 'alpha', prerelease: true}
]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}