[ci] Combine Runtime workflows
Merges most workflows into a single workflow, which should make the "Checks" tab easier to visualize sincee it will all be graphed in a single interface. There should be no change in behavior, this is a mechanical change. ghstack-source-id: a5241a24205a375555fd7f7d26339fb887070242 Pull Request resolved: https://github.com/facebook/react/pull/30324
Lauren Tan committed
Jul 12, 2024 at 12:26 UTC
1e8efe7fd401384226865fb4e220038f3505a748
5 files changed
+132
-175
.github/workflows/runtime_build_and_test.yml
renamed
+132
-1
@@ -1,4 +1,4 @@
1
-name: (Runtime) Build
1
+name: (Runtime) Build and Test
2
3
on:
4
push:
@@ -11,6 +11,137 @@ env:
11
TZ: /usr/share/zoneinfo/America/Los_Angeles
12
13
jobs:
14
+ # ----- FLOW -----
15
+ discover_flow_inline_configs:
16
+ name: Discover flow inline configs
17
+ runs-on: ubuntu-latest
18
+ outputs:
19
+ matrix: ${{ steps.set-matrix.outputs.result }}
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+ - uses: actions/github-script@v7
23
+ id: set-matrix
24
+ with:
25
+ script: |
26
+ const inlinedHostConfigs = require('./scripts/shared/inlinedHostConfigs.js');
27
+ return inlinedHostConfigs.map(config => config.shortName);
28
+
29
+ flow:
30
+ name: Flow check ${{ matrix.flow_inline_config_shortname }}
31
+ needs: discover_flow_inline_configs
32
+ runs-on: ubuntu-latest
33
+ continue-on-error: true
34
+ strategy:
35
+ matrix:
36
+ flow_inline_config_shortname: ${{ fromJSON(needs.discover_flow_inline_configs.outputs.matrix) }}
37
+ steps:
38
+ - uses: actions/checkout@v4
39
+ - uses: actions/setup-node@v4
40
+ with:
41
+ node-version: 18.20.1
42
+ cache: yarn
43
+ cache-dependency-path: yarn.lock
44
+ - name: Restore cached node_modules
45
+ uses: actions/cache@v4
46
+ id: node_modules
47
+ with:
48
+ path: "**/node_modules"
49
+ key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
50
+ - run: yarn install --frozen-lockfile
51
+ - run: node ./scripts/tasks/flow-ci ${{ matrix.flow_inline_config_shortname }}
52
+
53
+ # ----- FIZZ -----
54
+ check_generated_fizz_runtime:
55
+ name: Confirm generated inline Fizz runtime is up to date
56
+ runs-on: ubuntu-latest
57
+ steps:
58
+ - uses: actions/checkout@v4
59
+ - uses: actions/setup-node@v4
60
+ with:
61
+ node-version: 18.20.1
62
+ cache: yarn
63
+ cache-dependency-path: yarn.lock
64
+ - name: Restore cached node_modules
65
+ uses: actions/cache@v4
66
+ id: node_modules
67
+ with:
68
+ path: "**/node_modules"
69
+ key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
70
+ - run: yarn install --frozen-lockfile
71
+ - run: |
72
+ yarn generate-inline-fizz-runtime
73
+ git diff --quiet || (echo "There was a change to the Fizz runtime. Run `yarn generate-inline-fizz-runtime` and check in the result." && false)
74
+
75
+ # ----- FEATURE FLAGS -----
76
+ flags:
77
+ name: Check flags
78
+ runs-on: ubuntu-latest
79
+ steps:
80
+ - uses: actions/checkout@v4
81
+ - uses: actions/setup-node@v4
82
+ with:
83
+ node-version: 18.20.1
84
+ cache: yarn
85
+ cache-dependency-path: yarn.lock
86
+ - name: Restore cached node_modules
87
+ uses: actions/cache@v4
88
+ id: node_modules
89
+ with:
90
+ path: "**/node_modules"
91
+ key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
92
+ - run: yarn install --frozen-lockfile
93
+ - run: yarn flags
94
+
95
+ # ----- TESTS -----
96
+ test:
97
+ name: yarn test ${{ matrix.params }} (Shard ${{ matrix.shard }})
98
+ runs-on: ubuntu-latest
99
+ strategy:
100
+ matrix:
101
+ params:
102
+ - "-r=stable --env=development"
103
+ - "-r=stable --env=production"
104
+ - "-r=experimental --env=development"
105
+ - "-r=experimental --env=production"
106
+ - "-r=www-classic --env=development --variant=false"
107
+ - "-r=www-classic --env=production --variant=false"
108
+ - "-r=www-classic --env=development --variant=true"
109
+ - "-r=www-classic --env=production --variant=true"
110
+ - "-r=www-modern --env=development --variant=false"
111
+ - "-r=www-modern --env=production --variant=false"
112
+ - "-r=www-modern --env=development --variant=true"
113
+ - "-r=www-modern --env=production --variant=true"
114
+ - "-r=xplat --env=development --variant=false"
115
+ - "-r=xplat --env=development --variant=true"
116
+ - "-r=xplat --env=production --variant=false"
117
+ - "-r=xplat --env=production --variant=true"
118
+ # TODO: Test more persistent configurations?
119
+ - "-r=stable --env=development --persistent"
120
+ - "-r=experimental --env=development --persistent"
121
+ shard:
122
+ - 1/5
123
+ - 2/5
124
+ - 3/5
125
+ - 4/5
126
+ - 5/5
127
+ continue-on-error: true
128
+ steps:
129
+ - uses: actions/checkout@v4
130
+ - uses: actions/setup-node@v4
131
+ with:
132
+ node-version: 18.20.1
133
+ cache: yarn
134
+ cache-dependency-path: yarn.lock
135
+ - name: Restore cached node_modules
136
+ uses: actions/cache@v4
137
+ id: node_modules
138
+ with:
139
+ path: "**/node_modules"
140
+ key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
141
+ - run: yarn install --frozen-lockfile
142
+ - run: yarn test ${{ matrix.params }} --ci=github --shard=${{ matrix.shard }}
143
+
144
+ # ----- BUILD -----
145
build_and_lint:
146
name: yarn build and lint
147
runs-on: ubuntu-latest
.github/workflows/runtime_fizz.yml
deleted
-33
@@ -1,33 +0,0 @@
1
-name: (Runtime) Fizz
2
-
3
-on:
4
- push:
5
- branches: [main]
6
- pull_request:
7
- paths-ignore:
8
- - compiler/**
9
-
10
-env:
11
- TZ: /usr/share/zoneinfo/America/Los_Angeles
12
-
13
-jobs:
14
- check_generated_fizz_runtime:
15
- name: Confirm generated inline Fizz runtime is up to date
16
- runs-on: ubuntu-latest
17
- steps:
18
- - uses: actions/checkout@v4
19
- - uses: actions/setup-node@v4
20
- with:
21
- node-version: 18.20.1
22
- cache: yarn
23
- cache-dependency-path: yarn.lock
24
- - name: Restore cached node_modules
25
- uses: actions/cache@v4
26
- id: node_modules
27
- with:
28
- path: "**/node_modules"
29
- key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
30
- - run: yarn install --frozen-lockfile
31
- - run: |
32
- yarn generate-inline-fizz-runtime
33
- git diff --quiet || (echo "There was a change to the Fizz runtime. Run `yarn generate-inline-fizz-runtime` and check in the result." && false)
.github/workflows/runtime_flags.yml
deleted
-31
@@ -1,31 +0,0 @@
1
-name: (Runtime) Flags
2
-
3
-on:
4
- push:
5
- branches: [main]
6
- pull_request:
7
- paths-ignore:
8
- - compiler/**
9
-
10
-env:
11
- TZ: /usr/share/zoneinfo/America/Los_Angeles
12
-
13
-jobs:
14
- flags:
15
- name: Check flags
16
- runs-on: ubuntu-latest
17
- steps:
18
- - uses: actions/checkout@v4
19
- - uses: actions/setup-node@v4
20
- with:
21
- node-version: 18.20.1
22
- cache: yarn
23
- cache-dependency-path: yarn.lock
24
- - name: Restore cached node_modules
25
- uses: actions/cache@v4
26
- id: node_modules
27
- with:
28
- path: "**/node_modules"
29
- key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
30
- - run: yarn install --frozen-lockfile
31
- - run: yarn flags
.github/workflows/runtime_flow.yml
deleted
-50
@@ -1,50 +0,0 @@
1
-name: (Runtime) Flow
2
-
3
-on:
4
- push:
5
- branches: [main]
6
- pull_request:
7
- paths-ignore:
8
- - compiler/**
9
-
10
-env:
11
- TZ: /usr/share/zoneinfo/America/Los_Angeles
12
-
13
-jobs:
14
- discover_flow_inline_configs:
15
- name: Discover flow inline configs
16
- runs-on: ubuntu-latest
17
- outputs:
18
- matrix: ${{ steps.set-matrix.outputs.result }}
19
- steps:
20
- - uses: actions/checkout@v4
21
- - uses: actions/github-script@v7
22
- id: set-matrix
23
- with:
24
- script: |
25
- const inlinedHostConfigs = require('./scripts/shared/inlinedHostConfigs.js');
26
- return inlinedHostConfigs.map(config => config.shortName);
27
-
28
- flow:
29
- name: Flow check ${{ matrix.flow_inline_config_shortname }}
30
- needs: discover_flow_inline_configs
31
- runs-on: ubuntu-latest
32
- continue-on-error: true
33
- strategy:
34
- matrix:
35
- flow_inline_config_shortname: ${{ fromJSON(needs.discover_flow_inline_configs.outputs.matrix) }}
36
- steps:
37
- - uses: actions/checkout@v4
38
- - uses: actions/setup-node@v4
39
- with:
40
- node-version: 18.20.1
41
- cache: yarn
42
- cache-dependency-path: yarn.lock
43
- - name: Restore cached node_modules
44
- uses: actions/cache@v4
45
- id: node_modules
46
- with:
47
- path: "**/node_modules"
48
- key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
49
- - run: yarn install --frozen-lockfile
50
- - run: node ./scripts/tasks/flow-ci ${{ matrix.flow_inline_config_shortname }}
.github/workflows/runtime_test.yml
deleted
-60
@@ -1,60 +0,0 @@
1
-name: (Runtime) Test
2
-
3
-on:
4
- push:
5
- branches: [main]
6
- pull_request:
7
- paths-ignore:
8
- - compiler/**
9
-
10
-env:
11
- TZ: /usr/share/zoneinfo/America/Los_Angeles
12
-
13
-jobs:
14
- test:
15
- name: yarn test ${{ matrix.params }} (Shard ${{ matrix.shard }})
16
- runs-on: ubuntu-latest
17
- strategy:
18
- matrix:
19
- params:
20
- - "-r=stable --env=development"
21
- - "-r=stable --env=production"
22
- - "-r=experimental --env=development"
23
- - "-r=experimental --env=production"
24
- - "-r=www-classic --env=development --variant=false"
25
- - "-r=www-classic --env=production --variant=false"
26
- - "-r=www-classic --env=development --variant=true"
27
- - "-r=www-classic --env=production --variant=true"
28
- - "-r=www-modern --env=development --variant=false"
29
- - "-r=www-modern --env=production --variant=false"
30
- - "-r=www-modern --env=development --variant=true"
31
- - "-r=www-modern --env=production --variant=true"
32
- - "-r=xplat --env=development --variant=false"
33
- - "-r=xplat --env=development --variant=true"
34
- - "-r=xplat --env=production --variant=false"
35
- - "-r=xplat --env=production --variant=true"
36
- # TODO: Test more persistent configurations?
37
- - "-r=stable --env=development --persistent"
38
- - "-r=experimental --env=development --persistent"
39
- shard:
40
- - 1/5
41
- - 2/5
42
- - 3/5
43
- - 4/5
44
- - 5/5
45
- continue-on-error: true
46
- steps:
47
- - uses: actions/checkout@v4
48
- - uses: actions/setup-node@v4
49
- with:
50
- node-version: 18.20.1
51
- cache: yarn
52
- cache-dependency-path: yarn.lock
53
- - name: Restore cached node_modules
54
- uses: actions/cache@v4
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
- - run: yarn test ${{ matrix.params }} --ci=github --shard=${{ matrix.shard }}