Skip to content

Commit

Permalink
ci: update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
voxpelli committed Aug 5, 2024
1 parent 4dd89cf commit 5762337
Showing 1 changed file with 20 additions and 27 deletions.
47 changes: 20 additions & 27 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,31 @@
name: 'Build'
name: Build

on: ['push', 'pull_request']
on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: read

jobs:
build:
name: 'Test on node ${{ matrix.node_version }} and ${{ matrix.os }}'
runs-on: 'ubuntu-latest'
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: [12, 14, 16]
node_version: [12, 14, 16, 18, 20, 22]
os: ['ubuntu-latest']
steps:
- name: 'Checkout'
uses: 'actions/checkout@master'

- name: 'Use Node.js ${{ matrix.node_version }}'
uses: 'actions/setup-node@v2'
- uses: actions/checkout@v4
with:
node-version: '${{ matrix.node_version }}'

- name: 'Cache node modules'
uses: 'actions/cache@v2'
env:
cache-name: 'cache-node-modules'
persist-credentials: false
- uses: actions/setup-node@v4
with:
path: '~/.npm' # npm cache files are stored in `~/.npm` on Linux/macOS
key: "${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}"
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: 'Install Dependencies'
run: 'npm ci'

- name: 'Run Tests'
run: 'npm test'
node-version: ${{ matrix.node_version }}
cache: 'npm'
- run: npm ci --ignore-scripts
- run: npm test

0 comments on commit 5762337

Please sign in to comment.