Skip to content

Commit 8ebe42f

Browse files
committed
[ci] Cleanup --ci flag
This can be restored back to being a boolean instead of an enum ghstack-source-id: aca58fb7ea386ee489dd895e028f1aa2fc507193 Pull Request resolved: facebook#30508
1 parent e415b22 commit 8ebe42f

File tree

6 files changed

+15
-20
lines changed

6 files changed

+15
-20
lines changed

.github/workflows/devtools_regression_tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ jobs:
123123
- name: Display structure of build
124124
run: ls -R build
125125
- run: ./scripts/ci/download_devtools_regression_build.js ${{ matrix.version }} --replaceBuild
126-
- run: node ./scripts/jest/jest-cli.js --build --project devtools --release-channel=experimental --reactVersion ${{ matrix.version }} --ci=github
126+
- run: node ./scripts/jest/jest-cli.js --build --project devtools --release-channel=experimental --reactVersion ${{ matrix.version }} --ci
127127

128128
run_devtools_e2e_tests_for_versions:
129129
name: Run DevTools e2e tests for versions

.github/workflows/runtime_build_and_test.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ jobs:
141141
path: "**/node_modules"
142142
key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
143143
- run: yarn install --frozen-lockfile
144-
- run: yarn test ${{ matrix.params }} --ci=github --shard=${{ matrix.shard }}
144+
- run: yarn test ${{ matrix.params }} --ci --shard=${{ matrix.shard }}
145145

146146
# ----- BUILD -----
147147
build_and_lint:
@@ -170,7 +170,7 @@ jobs:
170170
path: "**/node_modules"
171171
key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
172172
- run: yarn install --frozen-lockfile
173-
- run: yarn build --index=${{ matrix.worker_id }} --total=20 --r=${{ matrix.release_channel }} --ci=github
173+
- run: yarn build --index=${{ matrix.worker_id }} --total=20 --r=${{ matrix.release_channel }} --ci
174174
env:
175175
CI: github
176176
RELEASE_CHANNEL: ${{ matrix.release_channel }}
@@ -248,7 +248,7 @@ jobs:
248248
merge-multiple: true
249249
- name: Display structure of build
250250
run: ls -R build
251-
- run: yarn test --build ${{ matrix.test_params }} --shard=${{ matrix.shard }} --ci=github
251+
- run: yarn test --build ${{ matrix.test_params }} --shard=${{ matrix.shard }} --ci
252252

253253
process_artifacts_combined:
254254
name: Process artifacts combined

.github/workflows/runtime_fuzz_tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ jobs:
3232
shell: bash
3333
- name: Run fuzz tests
3434
run: |-
35-
FUZZ_TEST_SEED=$RANDOM yarn test fuzz --ci=github
36-
FUZZ_TEST_SEED=$RANDOM yarn test --prod fuzz --ci=github
35+
FUZZ_TEST_SEED=$RANDOM yarn test fuzz --ci
36+
FUZZ_TEST_SEED=$RANDOM yarn test --prod fuzz --ci

scripts/jest/jest-cli.js

+4-9
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ const argv = yargs
9191
ci: {
9292
describe: 'Run tests in CI',
9393
requiresArg: false,
94-
type: 'choices',
95-
choices: ['circleci', 'github'],
94+
type: 'boolean',
95+
default: false,
9696
},
9797
compactConsole: {
9898
alias: 'c',
@@ -308,12 +308,7 @@ function getCommandArgs() {
308308
args.push('--useStderr');
309309
}
310310

311-
// CI Environments have limited workers.
312-
if (argv.ci === 'circleci') {
313-
args.push('--maxWorkers=2');
314-
}
315-
316-
if (argv.ci === 'github') {
311+
if (argv.ci === true) {
317312
args.push('--maxConcurrency=10');
318313
}
319314

@@ -368,7 +363,7 @@ function main() {
368363
const envars = getEnvars();
369364
const env = Object.entries(envars).map(([k, v]) => `${k}=${v}`);
370365

371-
if (argv.ci !== 'github') {
366+
if (argv.ci !== true) {
372367
// Print the full command we're actually running.
373368
const command = `$ ${env.join(' ')} node ${args.join(' ')}`;
374369
console.log(chalk.dim(command));

scripts/rollup/build-all-release-channels.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ const argv = yargs.wrap(yargs.terminalWidth()).options({
7676
ci: {
7777
describe: 'Run tests in CI',
7878
requiresArg: false,
79-
type: 'choices',
80-
choices: ['circleci', 'github'],
79+
type: 'boolean',
80+
default: false,
8181
},
8282
type: {
8383
describe: `Build the given bundle type. (${Object.values(
@@ -109,7 +109,7 @@ const argv = yargs.wrap(yargs.terminalWidth()).options({
109109
}).argv;
110110

111111
async function main() {
112-
if (argv.ci === 'github') {
112+
if (argv.ci === true) {
113113
buildForChannel(argv.releaseChannel, argv.total, argv.index);
114114
switch (argv.releaseChannel) {
115115
case 'stable': {
@@ -138,7 +138,7 @@ async function main() {
138138
// Then merge the experimental folder into the stable one. processExperimental
139139
// will have already removed conflicting files.
140140
//
141-
// In CI, merging is handled automatically by CircleCI's workspace feature.
141+
// In CI, merging is handled by the GitHub Download Artifacts plugin.
142142
mergeDirsSync(experimentalDir + '/', stableDir + '/');
143143

144144
// Now restore the combined directory back to its original name

scripts/rollup/stats.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const currentBuildResults = {
1818
};
1919

2020
function saveResults() {
21-
if (process.env.CI === 'github') {
21+
if (process.env.CI === true) {
2222
mkdirp.sync('build/sizes');
2323
fs.writeFileSync(
2424
join('build', 'sizes', `bundle-sizes-${process.env.NODE_INDEX}.json`),

0 commit comments

Comments
 (0)