From cd04f75e88298e9b8bf7fbb7934fe205d0f2a46f Mon Sep 17 00:00:00 2001 From: Jean-Michel FRANCOIS Date: Tue, 10 Oct 2023 10:26:42 +0200 Subject: [PATCH] chore: upgrade to node 20 (#4922) --- .github/actions/setup-node/action.yml | 32 +++++++++++++++++++ .github/workflows/changeset.yml | 11 ++----- .github/workflows/dependencies.yml | 7 +--- .../design-system-component-testing.yml | 8 ++--- .github/workflows/icons.yml | 8 ++--- .github/workflows/pr-lint.yml | 10 ++---- .github/workflows/pr-playground.yml | 8 ++--- .github/workflows/pr-test.yml | 8 +---- .github/workflows/surge-cleanup.yml | 12 +++---- .github/workflows/tests-cron.yml | 7 +--- .github/workflows/visual-testing.yml | 6 ++-- .github/workflows/yarn-deduplicate.yml | 7 +--- 12 files changed, 54 insertions(+), 70 deletions(-) create mode 100644 .github/actions/setup-node/action.yml diff --git a/.github/actions/setup-node/action.yml b/.github/actions/setup-node/action.yml new file mode 100644 index 00000000000..89bd8521e1a --- /dev/null +++ b/.github/actions/setup-node/action.yml @@ -0,0 +1,32 @@ +name: 'Setup nodejs' +description: 'Setup nodejs' +author: 'Talend' +secrets: + NPM_TOKEN: + description: 'The NPM token to use' +runs: + using: 'composite' + steps: + - name: Set up Node.js + uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d #v3.8.1 + with: + node-version: '20' + registry-url: 'https://registry.npmjs.org/' + scope: '@talend' + + - name: Install yarn + shell: bash + run: npm i -g yarn + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + shell: bash + run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT + + - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 #v3.3.2 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- diff --git a/.github/workflows/changeset.yml b/.github/workflows/changeset.yml index 5a55cab4a27..91147291ee4 100644 --- a/.github/workflows/changeset.yml +++ b/.github/workflows/changeset.yml @@ -29,14 +29,9 @@ jobs: fetch-depth: 0 persist-credentials: false - - name: Setup Node.js - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 - with: - node-version: 18 - registry-url: "https://registry.npmjs.org/" - scope: "@talend" - cache: "yarn" - + - name: Use Node.js + uses: ./.github/actions/setup-node + - name: Install Dependencies run: yarn --frozen-lockfile diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index 83ec2f60398..be1104fe28e 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -22,12 +22,7 @@ jobs: uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0 - name: Use Node.js - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 - with: - node-version: 18 - registry-url: "https://registry.npmjs.org/" - scope: "@talend" - cache: "yarn" + uses: ./.github/actions/setup-node - name: Upgrade dependencies run: | diff --git a/.github/workflows/design-system-component-testing.yml b/.github/workflows/design-system-component-testing.yml index 6eb5a721fe3..f8c47c05f79 100644 --- a/.github/workflows/design-system-component-testing.yml +++ b/.github/workflows/design-system-component-testing.yml @@ -24,12 +24,8 @@ jobs: - name: Checkout repository uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0 - - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 - with: - node-version: 18 - registry-url: "https://registry.npmjs.org/" - scope: "@talend" - cache: "yarn" + - name: Use Node.js + uses: ./.github/actions/setup-node - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 #v3.3.2 with: diff --git a/.github/workflows/icons.yml b/.github/workflows/icons.yml index c6104b3f400..04d6a4b7b2d 100644 --- a/.github/workflows/icons.yml +++ b/.github/workflows/icons.yml @@ -25,12 +25,8 @@ jobs: persist-credentials: false - name: Use Node.js - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 - with: - node-version: 18 - check-latest: true - cache: "yarn" - + uses: ./.github/actions/setup-node + - name: Download icons run: npx @talend/figma-icons-downloader env: diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml index f172765eef0..9dcc3c90db2 100644 --- a/.github/workflows/pr-lint.yml +++ b/.github/workflows/pr-lint.yml @@ -28,14 +28,8 @@ jobs: fetch-depth: 0 # otherwise, you will failed to push refs to dest repo - name: Use Node.js - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 - with: - node-version: 18 - check-latest: true - registry-url: "https://registry.npmjs.org/" - scope: "@talend" - cache: "yarn" - + uses: ./.github/actions/setup-node + - name: Install run: yarn install --frozen-lockfile --ignore-scripts diff --git a/.github/workflows/pr-playground.yml b/.github/workflows/pr-playground.yml index 0798d9371da..374f049c241 100644 --- a/.github/workflows/pr-playground.yml +++ b/.github/workflows/pr-playground.yml @@ -27,12 +27,8 @@ jobs: uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0 - name: Use Node.js - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 - with: - node-version: 18 - registry-url: "https://registry.npmjs.org/" - scope: "@talend" - cache: "yarn" + uses: ./.github/actions/setup-node + - name: Install and build playground id: build diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index b271fedefb7..f4a95de1790 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -24,13 +24,7 @@ jobs: uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0 - name: Use Node.js - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 - with: - node-version: 18 - check-latest: true - registry-url: "https://registry.npmjs.org/" - scope: "@talend" - cache: "yarn" + uses: ./.github/actions/setup-node - name: Install run: yarn install --frozen-lockfile diff --git a/.github/workflows/surge-cleanup.yml b/.github/workflows/surge-cleanup.yml index fc3a6106637..4bc6b29e9d9 100644 --- a/.github/workflows/surge-cleanup.yml +++ b/.github/workflows/surge-cleanup.yml @@ -13,10 +13,8 @@ jobs: environment: pull_request_unsafe steps: - - name: Use Node.js - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 - with: - node-version: 18 - - - name: Push to surge - run: npx surge teardown ${{ github.event.pull_request.number }}.talend.surge.sh --token ${{ secrets.SURGE_TOKEN }} + - name: Use Node.js + uses: ./.github/actions/setup-node + + - name: Push to surge + run: npx surge teardown ${{ github.event.pull_request.number }}.talend.surge.sh --token ${{ secrets.SURGE_TOKEN }} diff --git a/.github/workflows/tests-cron.yml b/.github/workflows/tests-cron.yml index 20362c668b7..1641011e9de 100644 --- a/.github/workflows/tests-cron.yml +++ b/.github/workflows/tests-cron.yml @@ -20,12 +20,7 @@ jobs: uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0 - name: Use Node.js - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 - with: - node-version: 18 - registry-url: "https://registry.npmjs.org/" - scope: "@talend" - cache: "yarn" + uses: ./.github/actions/setup-node - name: Install and tests run: | diff --git a/.github/workflows/visual-testing.yml b/.github/workflows/visual-testing.yml index 95d824a139d..7d2a26b5830 100644 --- a/.github/workflows/visual-testing.yml +++ b/.github/workflows/visual-testing.yml @@ -32,10 +32,8 @@ jobs: with: fetch-depth: 0 - - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 - with: - node-version: 18 - cache: "yarn" + - name: Use Node.js + uses: ./.github/actions/setup-node - name: Install dependencies run: yarn --frozen-lock diff --git a/.github/workflows/yarn-deduplicate.yml b/.github/workflows/yarn-deduplicate.yml index 601eab816fb..d9dfb8526d4 100644 --- a/.github/workflows/yarn-deduplicate.yml +++ b/.github/workflows/yarn-deduplicate.yml @@ -29,12 +29,7 @@ jobs: fetch-depth: 0 # otherwise, you will failed to push refs to dest repo - name: Use Node.js - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 - with: - node-version: 18 - registry-url: "https://registry.npmjs.org/" - scope: "@talend" - cache: "yarn" + uses: ./.github/actions/setup-node - name: yarn-deduplicate id: deduplicate