From d7de327db6f84184f443a1b04c991de0ce71da6e Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Fri, 21 Jun 2024 17:19:59 -0400 Subject: [PATCH] [ci] Cleanup - Made each workflow's name consistent - Rename each workflow file with consistent naming scheme - Promote flow-ci-ghaction to flow-ci ghstack-source-id: 5461a5022d8843c84b10e0f8e3cd7937b8e7cbdc Pull Request resolved: https://github.com/facebook/react/pull/30037 --- ...playground.yml => compiler_playground.yml} | 2 +- .../{compiler-rust.yml => compiler_rust.yml} | 2 +- ...typescript.yml => compiler_typescript.yml} | 2 +- .github/workflows/devtools_check_repro.yml | 2 +- ...facts.yml => runtime_commit_artifacts.yml} | 2 +- .../workflows/{fizz.yml => runtime_fizz.yml} | 2 +- .../{flags.yml => runtime_flags.yml} | 2 +- .../workflows/{flow.yml => runtime_flow.yml} | 4 +-- ...{fuzz_tests.yml => runtime_fuzz_tests.yml} | 2 +- .github/workflows/runtime_test.yml | 2 +- .../workflows/{lint.yml => shared_lint.yml} | 0 .../workflows/{stale.yml => shared_stale.yml} | 0 scripts/tasks/flow-ci-ghaction.js | 30 ------------------- scripts/tasks/flow-ci.js | 29 +++++++----------- 14 files changed, 22 insertions(+), 59 deletions(-) rename .github/workflows/{compiler-playground.yml => compiler_playground.yml} (96%) rename .github/workflows/{compiler-rust.yml => compiler_rust.yml} (98%) rename .github/workflows/{compiler-typescript.yml => compiler_typescript.yml} (98%) rename .github/workflows/{commit_artifacts.yml => runtime_commit_artifacts.yml} (99%) rename .github/workflows/{fizz.yml => runtime_fizz.yml} (97%) rename .github/workflows/{flags.yml => runtime_flags.yml} (96%) rename .github/workflows/{flow.yml => runtime_flow.yml} (92%) rename .github/workflows/{fuzz_tests.yml => runtime_fuzz_tests.yml} (96%) rename .github/workflows/{lint.yml => shared_lint.yml} (100%) rename .github/workflows/{stale.yml => shared_stale.yml} (100%) delete mode 100644 scripts/tasks/flow-ci-ghaction.js diff --git a/.github/workflows/compiler-playground.yml b/.github/workflows/compiler_playground.yml similarity index 96% rename from .github/workflows/compiler-playground.yml rename to .github/workflows/compiler_playground.yml index 5d97a2bff4cef..7f2a75d324d77 100644 --- a/.github/workflows/compiler-playground.yml +++ b/.github/workflows/compiler_playground.yml @@ -1,4 +1,4 @@ -name: Compiler Playground +name: (Compiler) Playground on: push: diff --git a/.github/workflows/compiler-rust.yml b/.github/workflows/compiler_rust.yml similarity index 98% rename from .github/workflows/compiler-rust.yml rename to .github/workflows/compiler_rust.yml index e492de11e0e33..cf911b9d476b3 100644 --- a/.github/workflows/compiler-rust.yml +++ b/.github/workflows/compiler_rust.yml @@ -1,4 +1,4 @@ -name: React Compiler (Rust) +name: (Compiler) Rust on: push: diff --git a/.github/workflows/compiler-typescript.yml b/.github/workflows/compiler_typescript.yml similarity index 98% rename from .github/workflows/compiler-typescript.yml rename to .github/workflows/compiler_typescript.yml index 71cfe426c171a..233e963bfad74 100644 --- a/.github/workflows/compiler-typescript.yml +++ b/.github/workflows/compiler_typescript.yml @@ -1,4 +1,4 @@ -name: React Compiler (TypeScript) +name: (Compiler) TypeScript on: push: diff --git a/.github/workflows/devtools_check_repro.yml b/.github/workflows/devtools_check_repro.yml index e0335e905939e..adaef6ac32bd6 100644 --- a/.github/workflows/devtools_check_repro.yml +++ b/.github/workflows/devtools_check_repro.yml @@ -1,4 +1,4 @@ -name: DevTools Check for bug repro +name: (DevTools) Check for bug repro on: issues: types: [opened, edited] diff --git a/.github/workflows/commit_artifacts.yml b/.github/workflows/runtime_commit_artifacts.yml similarity index 99% rename from .github/workflows/commit_artifacts.yml rename to .github/workflows/runtime_commit_artifacts.yml index 09d14b30baf4d..2c32281634c7c 100644 --- a/.github/workflows/commit_artifacts.yml +++ b/.github/workflows/runtime_commit_artifacts.yml @@ -1,4 +1,4 @@ -name: Commit Artifacts for Meta WWW and fbsource +name: (Runtime) Commit Artifacts for Meta WWW and fbsource on: push: diff --git a/.github/workflows/fizz.yml b/.github/workflows/runtime_fizz.yml similarity index 97% rename from .github/workflows/fizz.yml rename to .github/workflows/runtime_fizz.yml index 71b7bb843dd5f..43097728e37de 100644 --- a/.github/workflows/fizz.yml +++ b/.github/workflows/runtime_fizz.yml @@ -1,4 +1,4 @@ -name: Fizz +name: (Runtime) Fizz on: push: diff --git a/.github/workflows/flags.yml b/.github/workflows/runtime_flags.yml similarity index 96% rename from .github/workflows/flags.yml rename to .github/workflows/runtime_flags.yml index 66e6c5c211153..82c46cbbbead8 100644 --- a/.github/workflows/flags.yml +++ b/.github/workflows/runtime_flags.yml @@ -1,4 +1,4 @@ -name: Flags +name: Runtime (Flags) on: push: diff --git a/.github/workflows/flow.yml b/.github/workflows/runtime_flow.yml similarity index 92% rename from .github/workflows/flow.yml rename to .github/workflows/runtime_flow.yml index 11eb1f55e4cb7..6b8eb4b774e35 100644 --- a/.github/workflows/flow.yml +++ b/.github/workflows/runtime_flow.yml @@ -1,4 +1,4 @@ -name: Flow +name: (Runtime) Flow on: push: @@ -44,4 +44,4 @@ jobs: path: "**/node_modules" key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }} - run: yarn install --frozen-lockfile - - run: node ./scripts/tasks/flow-ci-ghaction ${{ matrix.flow_inline_config_shortname }} + - run: node ./scripts/tasks/flow-ci ${{ matrix.flow_inline_config_shortname }} diff --git a/.github/workflows/fuzz_tests.yml b/.github/workflows/runtime_fuzz_tests.yml similarity index 96% rename from .github/workflows/fuzz_tests.yml rename to .github/workflows/runtime_fuzz_tests.yml index 4c4373be373ea..5b31d115dcd23 100644 --- a/.github/workflows/fuzz_tests.yml +++ b/.github/workflows/runtime_fuzz_tests.yml @@ -1,4 +1,4 @@ -name: facebook/react/fuzz_tests +name: (Runtime) Fuzz tests on: schedule: - cron: 0 * * * * diff --git a/.github/workflows/runtime_test.yml b/.github/workflows/runtime_test.yml index 814dc3d4b9811..28b93171e793a 100644 --- a/.github/workflows/runtime_test.yml +++ b/.github/workflows/runtime_test.yml @@ -1,4 +1,4 @@ -name: React Runtime (Test) +name: Runtime (Test) on: push: diff --git a/.github/workflows/lint.yml b/.github/workflows/shared_lint.yml similarity index 100% rename from .github/workflows/lint.yml rename to .github/workflows/shared_lint.yml diff --git a/.github/workflows/stale.yml b/.github/workflows/shared_stale.yml similarity index 100% rename from .github/workflows/stale.yml rename to .github/workflows/shared_stale.yml diff --git a/scripts/tasks/flow-ci-ghaction.js b/scripts/tasks/flow-ci-ghaction.js deleted file mode 100644 index f420c80c37562..0000000000000 --- a/scripts/tasks/flow-ci-ghaction.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -'use strict'; - -process.on('unhandledRejection', err => { - throw err; -}); - -const runFlow = require('../flow/runFlow'); -const inlinedHostConfigs = require('../shared/inlinedHostConfigs'); - -async function check(shortName) { - if (shortName == null) { - throw new Error('Expected an inlinedHostConfig shortName'); - } - const rendererInfo = inlinedHostConfigs.find( - config => config.shortName === shortName - ); - if (rendererInfo.isFlowTyped) { - await runFlow(rendererInfo.shortName, ['check']); - console.log(); - } -} - -check(process.argv[2]); diff --git a/scripts/tasks/flow-ci.js b/scripts/tasks/flow-ci.js index c30e1b974bf9b..f420c80c37562 100644 --- a/scripts/tasks/flow-ci.js +++ b/scripts/tasks/flow-ci.js @@ -14,24 +14,17 @@ process.on('unhandledRejection', err => { const runFlow = require('../flow/runFlow'); const inlinedHostConfigs = require('../shared/inlinedHostConfigs'); -// Parallelize tests across multiple tasks. -const nodeTotal = process.env.CIRCLE_NODE_TOTAL - ? parseInt(process.env.CIRCLE_NODE_TOTAL, 10) - : 1; -const nodeIndex = process.env.CIRCLE_NODE_INDEX - ? parseInt(process.env.CIRCLE_NODE_INDEX, 10) - : 0; - -async function checkAll() { - for (let i = 0; i < inlinedHostConfigs.length; i++) { - if (i % nodeTotal === nodeIndex) { - const rendererInfo = inlinedHostConfigs[i]; - if (rendererInfo.isFlowTyped) { - await runFlow(rendererInfo.shortName, ['check']); - console.log(); - } - } +async function check(shortName) { + if (shortName == null) { + throw new Error('Expected an inlinedHostConfig shortName'); + } + const rendererInfo = inlinedHostConfigs.find( + config => config.shortName === shortName + ); + if (rendererInfo.isFlowTyped) { + await runFlow(rendererInfo.shortName, ['check']); + console.log(); } } -checkAll(); +check(process.argv[2]);