Skip to content

Commit

Permalink
ci: run the ci pipeline on different version of nodejs
Browse files Browse the repository at this point in the history
  • Loading branch information
thiren committed Oct 22, 2024
1 parent a9190a0 commit 4f6d92a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 36 deletions.
36 changes: 12 additions & 24 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Build"
name: "Build & Test"

on:
push:
Expand All @@ -13,18 +13,22 @@ concurrency:

jobs:
build:
name: Build
name: Build & Test
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Check out repo
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: 18
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/
# Skip post-install scripts here, as a malicious
# script could steal NODE_AUTH_TOKEN.

- name: Install NPM dependencies
run: npm install --ignore-scripts

Expand All @@ -34,21 +38,5 @@ jobs:
- name: Run tests
run: npm run test-ci

pack:
name: NPM Pack
needs: build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org/
# Skip post-install scripts here, as a malicious
# script could steal NODE_AUTH_TOKEN.
- name: Install NPM dependencies
run: npm install --ignore-scripts --production

- name: Run NPM pack
run: npm pack
6 changes: 3 additions & 3 deletions .github/workflows/ci-codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -38,4 +38,4 @@ jobs:
# queries: ./path/to/local/query, your-org/your-repo/queries@main

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
17 changes: 8 additions & 9 deletions .github/workflows/ci-npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ jobs:
build:
name: Build
runs-on: ubuntu-latest

timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Check out repo
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
registry-url: https://registry.npmjs.org/
# Skip post-install scripts here, as a malicious
# script could steal NODE_AUTH_TOKEN.
Expand All @@ -28,15 +29,13 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check out repo
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
registry-url: https://registry.npmjs.org/
# Skip post-install scripts here, as a malicious
# script could steal NODE_AUTH_TOKEN.
- name: Install NPM dependencies
run: npm install --ignore-scripts --production

- name: Run NPM publish
run: npm publish --access public
Expand Down

0 comments on commit 4f6d92a

Please sign in to comment.