[ci] Cleanup --ci flag

This can be restored back to being a boolean instead of an enum

ghstack-source-id: aca58fb7ea386ee489dd895e028f1aa2fc507193
Pull Request resolved: https://github.com/facebook/react/pull/30508
This commit is contained in:
Lauren Tan 2024-07-29 18:51:20 -04:00
parent e415b22494
commit 8ebe42f17c
No known key found for this signature in database
GPG Key ID: D9B8BF35B75B9883
6 changed files with 15 additions and 20 deletions

View File

@ -123,7 +123,7 @@ jobs:
- name: Display structure of build
run: ls -R build
- run: ./scripts/ci/download_devtools_regression_build.js ${{ matrix.version }} --replaceBuild
- run: node ./scripts/jest/jest-cli.js --build --project devtools --release-channel=experimental --reactVersion ${{ matrix.version }} --ci=github
- run: node ./scripts/jest/jest-cli.js --build --project devtools --release-channel=experimental --reactVersion ${{ matrix.version }} --ci
run_devtools_e2e_tests_for_versions:
name: Run DevTools e2e tests for versions

View File

@ -141,7 +141,7 @@ jobs:
path: "**/node_modules"
key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
- run: yarn install --frozen-lockfile
- run: yarn test ${{ matrix.params }} --ci=github --shard=${{ matrix.shard }}
- run: yarn test ${{ matrix.params }} --ci --shard=${{ matrix.shard }}
# ----- BUILD -----
build_and_lint:
@ -170,7 +170,7 @@ jobs:
path: "**/node_modules"
key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
- run: yarn install --frozen-lockfile
- run: yarn build --index=${{ matrix.worker_id }} --total=20 --r=${{ matrix.release_channel }} --ci=github
- run: yarn build --index=${{ matrix.worker_id }} --total=20 --r=${{ matrix.release_channel }} --ci
env:
CI: github
RELEASE_CHANNEL: ${{ matrix.release_channel }}
@ -248,7 +248,7 @@ jobs:
merge-multiple: true
- name: Display structure of build
run: ls -R build
- run: yarn test --build ${{ matrix.test_params }} --shard=${{ matrix.shard }} --ci=github
- run: yarn test --build ${{ matrix.test_params }} --shard=${{ matrix.shard }} --ci
process_artifacts_combined:
name: Process artifacts combined

View File

@ -32,5 +32,5 @@ jobs:
shell: bash
- name: Run fuzz tests
run: |-
FUZZ_TEST_SEED=$RANDOM yarn test fuzz --ci=github
FUZZ_TEST_SEED=$RANDOM yarn test --prod fuzz --ci=github
FUZZ_TEST_SEED=$RANDOM yarn test fuzz --ci
FUZZ_TEST_SEED=$RANDOM yarn test --prod fuzz --ci

View File

@ -91,8 +91,8 @@ const argv = yargs
ci: {
describe: 'Run tests in CI',
requiresArg: false,
type: 'choices',
choices: ['circleci', 'github'],
type: 'boolean',
default: false,
},
compactConsole: {
alias: 'c',
@ -308,12 +308,7 @@ function getCommandArgs() {
args.push('--useStderr');
}
// CI Environments have limited workers.
if (argv.ci === 'circleci') {
args.push('--maxWorkers=2');
}
if (argv.ci === 'github') {
if (argv.ci === true) {
args.push('--maxConcurrency=10');
}
@ -368,7 +363,7 @@ function main() {
const envars = getEnvars();
const env = Object.entries(envars).map(([k, v]) => `${k}=${v}`);
if (argv.ci !== 'github') {
if (argv.ci !== true) {
// Print the full command we're actually running.
const command = `$ ${env.join(' ')} node ${args.join(' ')}`;
console.log(chalk.dim(command));

View File

@ -76,8 +76,8 @@ const argv = yargs.wrap(yargs.terminalWidth()).options({
ci: {
describe: 'Run tests in CI',
requiresArg: false,
type: 'choices',
choices: ['circleci', 'github'],
type: 'boolean',
default: false,
},
type: {
describe: `Build the given bundle type. (${Object.values(
@ -109,7 +109,7 @@ const argv = yargs.wrap(yargs.terminalWidth()).options({
}).argv;
async function main() {
if (argv.ci === 'github') {
if (argv.ci === true) {
buildForChannel(argv.releaseChannel, argv.total, argv.index);
switch (argv.releaseChannel) {
case 'stable': {
@ -138,7 +138,7 @@ async function main() {
// Then merge the experimental folder into the stable one. processExperimental
// will have already removed conflicting files.
//
// In CI, merging is handled automatically by CircleCI's workspace feature.
// In CI, merging is handled by the GitHub Download Artifacts plugin.
mergeDirsSync(experimentalDir + '/', stableDir + '/');
// Now restore the combined directory back to its original name

View File

@ -18,7 +18,7 @@ const currentBuildResults = {
};
function saveResults() {
if (process.env.CI === 'github') {
if (process.env.CI === true) {
mkdirp.sync('build/sizes');
fs.writeFileSync(
join('build', 'sizes', `bundle-sizes-${process.env.NODE_INDEX}.json`),