-
Notifications
You must be signed in to change notification settings - Fork 63
47 lines (43 loc) · 1.5 KB
/
nodejs.yml
File metadata and controls
47 lines (43 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Node CI
on:
push:
branches-ignore:
- 'dependabot/**'
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version:
- lts/-2
- lts/-1
- lts/*
- current
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install
run: npm ci
- name: Node version
id: version
run: echo "node-version=$(node -v)" >> $GITHUB_OUTPUT
- name: Test
id: test
run: npm test
continue-on-error: ${{ matrix.node-version == 'current' }}
- name: Create Issue on Fail
if: ${{ matrix.node-version == 'current' && steps.test.outcome != 'success' }}
uses: actions/github-script@v6
with:
script: |
github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: 'Test failed on Node.js ${{ matrix.node-version }} (${{ steps.version.outputs.node-version }})',
body: 'The test failed on Node.js ${{ steps.version.outputs.node-version }}, [possibly due to a new version being promoted to node@current](https://github.com/nodejs/release#release-schedule). See [Action run output](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) for more information.'
})