CI: lint & test on PRs too, with Node 18-22 💚

This commit is contained in:
Jannis R 2024-08-08 16:00:29 +02:00
parent 76358235ab
commit 66ca7d32e5
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
2 changed files with 36 additions and 12 deletions

View file

@ -6,18 +6,7 @@ on:
jobs: jobs:
lint-test: lint-test:
name: lint, build & test name: lint, build & test
runs-on: ubuntu-latest uses: './.github/workflows/lint-test.yml'
steps:
- name: checkout
uses: actions/checkout@v3
- name: setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
- run: npm ci
- run: npm run lint
- run: npm run build
- run: npm test
build-and-publish: build-and-publish:
name: build & publish Docker image name: build & publish Docker image

35
.github/workflows/lint-test.yml vendored Normal file
View file

@ -0,0 +1,35 @@
name: lint, build & test
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
workflow_call:
jobs:
lint-test:
name: lint, build & test
runs-on: ubuntu-latest
strategy:
matrix:
node-version:
- '16.x'
- '18.x'
- '20.x'
- '22.x'
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run lint
- run: npm run build
- run: npm test