Skip to content

Commit

Permalink
[CI][workflows] use node 20 by default
Browse files Browse the repository at this point in the history
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 <marc.dumais@ericsson.com>
  • Loading branch information
marcdumais-work committed Feb 10, 2025
1 parent 330403d commit d3f9662
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
27 changes: 16 additions & 11 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,25 @@ 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
uses: actions/checkout@v4
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
Expand All @@ -50,25 +51,27 @@ 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
uses: actions/checkout@v4
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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/license-check-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand Down

0 comments on commit d3f9662

Please sign in to comment.