-
Notifications
You must be signed in to change notification settings - Fork 144
57 lines (54 loc) · 1.67 KB
/
run-tests.yml
File metadata and controls
57 lines (54 loc) · 1.67 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
48
49
50
51
52
53
54
55
56
57
name: Run tests
on:
push:
branches:
- master
- beta
- alpha
pull_request:
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Use node 24
uses: actions/setup-node@v1
with:
node-version: 24
- name: Install depencencies
run: npm ci
- name: Run tests
run: npm run test
release:
needs: build-and-test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/alpha'
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for trusted publishing and npm provenance
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Use node 24
uses: actions/setup-node@v1
with:
node-version: 24
- uses: svrooij/secret-gate-action@v1 # see https://github.com/svrooij/secret-gate-action this is to fail quiet until secret is set.
id: mygate
with:
inputsToCheck: 'NPM_TOKEN'
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Install depencencies
if: steps.mygate.outputs.inputsChecked == 'true'
run: npm ci
- name: Run tests
if: steps.mygate.outputs.inputsChecked == 'true'
run: npm run test
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release