From d3f966288524ff15992547228e99496c40ab005e Mon Sep 17 00:00:00 2001 From: Marc Dumais Date: Thu, 6 Feb 2025 15:43:38 -0500 Subject: [PATCH] [CI][workflows] use node 20 by default Prepare for node.js 18 EoL and transition to node 20 as default - start using node 20 for jobs like linting, publishing and license check - Add Node 20 and node 22 to the matrix for "build and test" job - (for now) Keep node 18 as part of the "matrix" for "build and test job". We can remove it once officially EoL The plan is to remove node 18 soon, when it's officially EoL. Signed-off-by: Marc Dumais --- .github/workflows/ci-cd.yml | 27 ++++++++++++-------- .github/workflows/license-check-workflow.yml | 6 ++--- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 70061d9..5519ee5 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -14,13 +14,14 @@ on: jobs: build: + name: Build and Test (${{ matrix.os }}, node-${{ matrix.node-version }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest] - node: [18] + node-version: [18, 20, 22] steps: - name: Checkout @@ -28,10 +29,10 @@ jobs: with: persist-credentials: false - - name: Use Node.js ${{ matrix.node }} + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node }} + node-version: ${{ matrix.node-version }} registry-url: 'https://registry.npmjs.org' - name: Build @@ -50,14 +51,16 @@ jobs: NODE_OPTIONS: "--max_old_space_size=4096" publish-next: + name: Publish to npm (next) needs: build if: github.ref == 'refs/heads/master' && github.event_name == 'push' && github.repository == 'eclipse-cdt-cloud/timeline-chart' - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: - node: [18] + os: [ubuntu-latest] + node-version: [20] steps: - name: Checkout @@ -65,10 +68,10 @@ jobs: with: persist-credentials: false - - name: Use Node.js ${{ matrix.node }} + - name: Use Node.js ${{ matrix.node-version}} uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node }} + node-version: ${{ matrix.node-version }} registry-url: 'https://registry.npmjs.org' - name: Pre-Publish @@ -91,21 +94,23 @@ jobs: NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} # The variable name comes from here: https://github.com/actions/setup-node/blob/70b9252472eee7495c93bb1588261539c3c2b98d/src/authutil.ts#L48 publish-latest: + name: Publish to npm (latest) needs: build if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'eclipse-cdt-cloud/timeline-chart' - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: - node: [18] + os: [ubuntu-latest] + node-version: [20] steps: - name: Checkout uses: actions/checkout@v3 with: persist-credentials: false - - name: Use Node.js ${{ matrix.node }} + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node }} + node-version: ${{ matrix.node-version }} registry-url: 'https://registry.npmjs.org' - name: Pre-Publish shell: bash diff --git a/.github/workflows/license-check-workflow.yml b/.github/workflows/license-check-workflow.yml index b79f9f6..922ac6b 100644 --- a/.github/workflows/license-check-workflow.yml +++ b/.github/workflows/license-check-workflow.yml @@ -14,13 +14,13 @@ on: jobs: License-check: - name: 3PP License Check using dash-licenses + name: 3PP License Check using dash-licenses (${{ matrix.os }}) strategy: fail-fast: false matrix: os: [ubuntu-latest] - node: [18] + node-version: [20] java: [11] runs-on: ${{ matrix.os }} @@ -35,7 +35,7 @@ jobs: - name: Use Node.js ${{ matrix.node }} uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node }} + node-version: ${{ matrix.node-version }} - name: Use Java ${{ matrix.java }} uses: actions/setup-java@v3