proj4js/.github/workflows/build-and-test.yml
2025-02-11 21:47:11 +01:00

70 lines
1.5 KiB
YAML

name: Node.js CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
name: Build and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 22.x
uses: actions/setup-node@v3
with:
node-version: 22.x
cache: 'npm'
- run: npm ci
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
test-coverage:
name: Test coverage
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Use Node.js 22.x
uses: actions/setup-node@v3
with:
node-version: 22.x
cache: 'npm'
- run: npm install --no-save nyc chai
- run: npm run test:coverage
test-node:
name: Test older node versions
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm install --no-save chai
- run: npm run test:ci