[ci] Split out babel-plugin-react-forget jest to its own job
Lauren Tan committed
Aug 18, 2023 at 17:06 UTC
6be03b681e330054d8a7ea6d8348c8ae13285528
2 files changed
+28
-3
compiler/.github/workflows/typescript.yml
+27
-2
@@ -7,6 +7,7 @@ on:
7
8
jobs:
9
discover_yarn_workspaces:
10
+ name: Discover yarn workspaces
11
runs-on: ubuntu-latest
12
outputs:
13
matrix: ${{ steps.set-matrix.outputs.matrix }}
@@ -15,6 +16,7 @@ jobs:
16
- id: set-matrix
17
run: echo "matrix=$(find forget/packages -mindepth 1 -maxdepth 1 -type d | sed 's!forget/packages/!!g' | tr '\n' ',' | sed s/.$// | jq -Rsc '. / "," - [""]')" >> $GITHUB_OUTPUT
18
19
+ # Hardcoded to improve parallelism for babel-plugin-react-forget
20
lint:
21
name: Lint babel-plugin-react-forget
22
runs-on: ubuntu-latest
@@ -25,7 +27,7 @@ jobs:
27
node-version: 18.x
28
cache: "yarn"
29
cache-dependency-path: forget/yarn.lock
28
- - name: cache node_modules
30
+ - name: Restore cached node_modules
31
uses: actions/cache@v3
32
with:
33
path: "**/node_modules"
@@ -37,6 +39,28 @@ jobs:
39
- run: yarn workspace babel-plugin-react-forget lint
40
working-directory: forget
41
42
+ # Hardcoded to improve parallelism for babel-plugin-react-forget
43
+ jest:
44
+ name: Jest babel-plugin-react-forget
45
+ runs-on: ubuntu-latest
46
+ steps:
47
+ - uses: actions/checkout@v3
48
+ - uses: actions/setup-node@v3
49
+ with:
50
+ node-version: 18.x
51
+ cache: "yarn"
52
+ cache-dependency-path: forget/yarn.lock
53
+ - name: Restore cached node_modules
54
+ uses: actions/cache@v3
55
+ id: node_modules
56
+ with:
57
+ path: "**/node_modules"
58
+ key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
59
+ - run: yarn install --frozen-lockfile
60
+ working-directory: forget
61
+ - run: yarn workspace babel-plugin-react-forget jest
62
+ working-directory: forget
63
+
64
test:
65
name: Test ${{ matrix.workspace_name }}
66
needs: discover_yarn_workspaces
@@ -52,8 +76,9 @@ jobs:
76
node-version: 18.x
77
cache: "yarn"
78
cache-dependency-path: forget/yarn.lock
55
- - name: cache node_modules
79
+ - name: Restore cached node_modules
80
uses: actions/cache@v3
81
+ id: node_modules
82
with:
83
path: "**/node_modules"
84
key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
compiler/forget/packages/babel-plugin-react-forget/package.json
+1
-1
@@ -9,7 +9,7 @@
9
],
10
"scripts": {
11
"build": "rimraf dist && tsc",
12
- "test": "concurrently -g -n jest,snap,sprout \"yarn jest\" \"yarn snap:ci\" \"yarn sprout:ci\"",
12
+ "test": "concurrently -g -n snap,sprout \"yarn snap:ci\" \"yarn sprout:ci\"",
13
"jest": "tsc && ts-node \"$(yarn --silent which jest)\"",
14
"snap": "node ../snap/dist/main.js",
15
"snap:build": "yarn workspace snap run build",