-
Notifications
You must be signed in to change notification settings - Fork 41
114 lines (99 loc) · 3.05 KB
/
ci.yaml
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# This is a Github Workflow that runs tests on any push or pull request.
# If the tests pass and this is a push to the master branch it also runs Semantic Release.
name: CI
on: [push, pull_request]
jobs:
# Handle [skip ci] / [ci skip] directives in commit messages
init:
if: github.event_name == 'push'
name: init
runs-on: ubuntu-20.04
outputs:
skip: ${{ steps.ci-skip-step.outputs.ci-skip }}
skip-not: ${{ steps.ci-skip-step.outputs.ci-skip-not }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- id: ci-skip-step
uses: mstachniuk/ci-skip@v1
# Fast unit tests flow
test_push:
if: github.event_name == 'push'
needs: init
runs-on: ubuntu-20.04
steps:
- name: Checkuout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup NodeJS
uses: actions/setup-node@v2
with:
node-version: 16
- name: Yarn install
run: yarn
- name: Unit test only
run: yarn cover:unit
- name: Coveralls
if: github.ref == 'refs/heads/master'
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
# Full tests for PR
test_pr:
if: github.event_name == 'pull_request'
strategy:
matrix:
os: [ windows-2019, ubuntu-20.04 ]
node-version: [ 12, 14, 16 ]
name: Test (Node v${{ matrix.node-version }}, OS ${{ matrix.os }})
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup NodeJS v${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Yarn install
run: yarn
- name: Intergarion test
if: matrix.node-version != '16' || matrix.os != 'ubuntu-20.04'
run: cli/synp.js -s yarn.lock
- name: Full test suite
if: matrix.node-version == '16' && matrix.os == 'ubuntu-20.04'
run: yarn test
# Release
release:
name: Release
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-20.04
needs: test_push
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup NodeJS
uses: actions/setup-node@v2
with:
node-version: 16
- name: Yarn install
run: yarn
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
with:
extra_plugins: |
@semantic-release/changelog@6
@semantic-release/git@10
@semantic-release/github@8
@semantic-release/npm@8
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_AUTHOR_EMAIL: '[email protected]'
GIT_COMMITTER_EMAIL: '[email protected]'
GIT_AUTHOR_NAME: '@antongolub'
GIT_COMMITTER_NAME: '@antongolub'