ci: add workflow for running the eslint plugin e2e tests (#32397)
This change adds a workflow for PR builds, that runs the e2e tests for `eslint-plugin-react-hooks` created in #32396 
michael faith committed
Feb 16, 2025 at 16:00 UTC
eb1f77dedfc8f7491ecd39b160e4743fa39dfc99
13 files changed
+96
-12
.github/workflows/runtime_eslint_plugin_e2e.yml
new
+56
@@ -0,0 +1,56 @@
1
+name: (Runtime) ESLint Plugin E2E
2
+
3
+on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ paths-ignore:
8
+ - compiler/**
9
+
10
+concurrency:
11
+ group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.run_id }}
12
+ cancel-in-progress: true
13
+
14
+env:
15
+ TZ: /usr/share/zoneinfo/America/Los_Angeles
16
+
17
+jobs:
18
+ # ----- TESTS -----
19
+ test:
20
+ name: ESLint v${{ matrix.eslint_major }}
21
+ runs-on: ubuntu-latest
22
+ strategy:
23
+ matrix:
24
+ eslint_major:
25
+ - "6"
26
+ - "7"
27
+ - "8"
28
+ - "9"
29
+ continue-on-error: true
30
+ steps:
31
+ - uses: actions/checkout@v4
32
+ with:
33
+ ref: ${{ github.event.pull_request.head.sha || github.sha }}
34
+ - uses: actions/setup-node@v4
35
+ with:
36
+ node-version-file: '.nvmrc'
37
+ cache: yarn
38
+ cache-dependency-path: yarn.lock
39
+ - name: Restore cached node_modules
40
+ uses: actions/cache@v4
41
+ id: node_modules
42
+ with:
43
+ path: "**/node_modules"
44
+ key: runtime-eslint_e2e-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
45
+ - name: Ensure clean build directory
46
+ run: rm -rf build
47
+ - run: yarn install --frozen-lockfile
48
+ - name: Build plugin
49
+ working-directory: fixtures/eslint-v${{ matrix.eslint_major }}
50
+ run: node build.mjs
51
+ - name: Install fixture dependencies
52
+ working-directory: ./fixtures/eslint-v${{ matrix.eslint_major }}
53
+ run: yarn --frozen-lockfile
54
+ - name: Run lint test
55
+ working-directory: ./fixtures/eslint-v${{ matrix.eslint_major }}
56
+ run: yarn lint
fixtures/eslint-v6/build.mjs
+8
-1
@@ -1,5 +1,12 @@
1
#!/usr/bin/env node
2
3
import {exec} from 'node:child_process';
4
+import {dirname, resolve} from 'node:path';
5
+import {fileURLToPath} from 'node:url';
6
5
-exec('cd ../.. && yarn build -r stable eslint-plugin-react-hooks');
7
+const __filename = fileURLToPath(import.meta.url);
8
+const __dirname = dirname(__filename);
9
+
10
+exec('yarn build -r stable eslint-plugin-react-hooks', {
11
+ cwd: resolve(__dirname, '..', '..'),
12
+});
fixtures/eslint-v6/package.json
+1
-1
@@ -3,7 +3,7 @@
3
"name": "eslint-v6",
4
"dependencies": {
5
"eslint": "^6",
6
- "eslint-plugin-react-hooks": "link:../../build/node_modules/eslint-plugin-react-hooks"
6
+ "eslint-plugin-react-hooks": "link:../../build/oss-stable/eslint-plugin-react-hooks"
7
},
8
"scripts": {
9
"build": "node build.mjs && yarn",
fixtures/eslint-v6/yarn.lock
+1
-1
@@ -205,7 +205,7 @@ escape-string-regexp@^1.0.5:
205
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
206
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
207
208
-"eslint-plugin-react-hooks@link:../../build/node_modules/eslint-plugin-react-hooks":
208
+"eslint-plugin-react-hooks@link:../../build/oss-stable/eslint-plugin-react-hooks":
209
version "0.0.0"
210
uid ""
211
fixtures/eslint-v7/build.mjs
+8
-1
@@ -1,5 +1,12 @@
1
#!/usr/bin/env node
2
3
import {exec} from 'node:child_process';
4
+import {dirname, resolve} from 'node:path';
5
+import {fileURLToPath} from 'node:url';
6
5
-exec('cd ../.. && yarn build -r stable eslint-plugin-react-hooks');
7
+const __filename = fileURLToPath(import.meta.url);
8
+const __dirname = dirname(__filename);
9
+
10
+exec('yarn build -r stable eslint-plugin-react-hooks', {
11
+ cwd: resolve(__dirname, '..', '..'),
12
+});
fixtures/eslint-v7/package.json
+1
-1
@@ -3,7 +3,7 @@
3
"name": "eslint-v7",
4
"dependencies": {
5
"eslint": "^7",
6
- "eslint-plugin-react-hooks": "link:../../build/node_modules/eslint-plugin-react-hooks"
6
+ "eslint-plugin-react-hooks": "link:../../build/oss-stable/eslint-plugin-react-hooks"
7
},
8
"scripts": {
9
"build": "node build.mjs && yarn",
fixtures/eslint-v7/yarn.lock
+1
-1
@@ -234,7 +234,7 @@ escape-string-regexp@^4.0.0:
234
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
235
integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==
236
237
-"eslint-plugin-react-hooks@link:../../build/node_modules/eslint-plugin-react-hooks":
237
+"eslint-plugin-react-hooks@link:../../build/oss-stable/eslint-plugin-react-hooks":
238
version "0.0.0"
239
uid ""
240
fixtures/eslint-v8/build.mjs
+8
-1
@@ -1,5 +1,12 @@
1
#!/usr/bin/env node
2
3
import {exec} from 'node:child_process';
4
+import {dirname, resolve} from 'node:path';
5
+import {fileURLToPath} from 'node:url';
6
5
-exec('cd ../.. && yarn build -r stable eslint-plugin-react-hooks');
7
+const __filename = fileURLToPath(import.meta.url);
8
+const __dirname = dirname(__filename);
9
+
10
+exec('yarn build -r stable eslint-plugin-react-hooks', {
11
+ cwd: resolve(__dirname, '..', '..'),
12
+});
fixtures/eslint-v8/package.json
+1
-1
@@ -3,7 +3,7 @@
3
"name": "eslint-v8",
4
"dependencies": {
5
"eslint": "^8",
6
- "eslint-plugin-react-hooks": "link:../../build/node_modules/eslint-plugin-react-hooks"
6
+ "eslint-plugin-react-hooks": "link:../../build/oss-stable/eslint-plugin-react-hooks"
7
},
8
"scripts": {
9
"build": "node build.mjs && yarn",
fixtures/eslint-v8/yarn.lock
+1
-1
@@ -192,7 +192,7 @@ escape-string-regexp@^4.0.0:
192
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
193
integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==
194
195
-"eslint-plugin-react-hooks@link:../../build/node_modules/eslint-plugin-react-hooks":
195
+"eslint-plugin-react-hooks@link:../../build/oss-stable/eslint-plugin-react-hooks":
196
version "0.0.0"
197
uid ""
198
fixtures/eslint-v9/build.mjs
+8
-1
@@ -1,5 +1,12 @@
1
#!/usr/bin/env node
2
3
import {exec} from 'node:child_process';
4
+import {dirname, resolve} from 'node:path';
5
+import {fileURLToPath} from 'node:url';
6
5
-exec('cd ../.. && yarn build -r stable eslint-plugin-react-hooks');
7
+const __filename = fileURLToPath(import.meta.url);
8
+const __dirname = dirname(__filename);
9
+
10
+exec('yarn build -r stable eslint-plugin-react-hooks', {
11
+ cwd: resolve(__dirname, '..', '..'),
12
+});
fixtures/eslint-v9/package.json
+1
-1
@@ -3,7 +3,7 @@
3
"name": "eslint-v9",
4
"dependencies": {
5
"eslint": "^9",
6
- "eslint-plugin-react-hooks": "link:../../build/node_modules/eslint-plugin-react-hooks"
6
+ "eslint-plugin-react-hooks": "link:../../build/oss-stable/eslint-plugin-react-hooks"
7
},
8
"scripts": {
9
"build": "node build.mjs && yarn",
fixtures/eslint-v9/yarn.lock
+1
-1
@@ -209,7 +209,7 @@ escape-string-regexp@^4.0.0:
209
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
210
integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==
211
212
-"eslint-plugin-react-hooks@link:../../build/node_modules/eslint-plugin-react-hooks":
212
+"eslint-plugin-react-hooks@link:../../build/oss-stable/eslint-plugin-react-hooks":
213
version "0.0.0"
214
uid ""
215