This repository was archived by the owner on Apr 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (55 loc) · 1.74 KB
/
ci-cd.yaml
File metadata and controls
58 lines (55 loc) · 1.74 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
58
name: CI/CD
on:
pull_request:
push:
branches:
- master
jobs:
tests:
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
node: [10, 12, 13, 14]
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node.js ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm run test
- name: Upload coverage data
uses: codecov/codecov-action@v1
release:
name: Release
needs: tests
if: "github.event_name == 'push' && !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
# Do not persist the GH token, so that the release step uses its own credentials.
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 14
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
GIT_AUTHOR_NAME: github-actions
GIT_AUTHOR_EMAIL: 44210433+github-actions@users.noreply.github.com
GIT_COMMITTER_NAME: github-actions
GIT_COMMITTER_EMAIL: 44210433+github-actions@users.noreply.github.com
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release