-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (62 loc) · 1.66 KB
/
cicd.yml
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
name: CI/CD
on:
pull_request:
push:
branches:
- main
jobs:
test:
name: Test
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "yarn"
- name: Set up yarn cache directory
id: yarn-cache-dir-path
run: |
echo "::set-output name=dir::$(yarn cache dir)"
- run: yarn install --frozen-lockfile
- run: yarn test:coverage
if: runner.os == 'macOs'
- run: xvfb-run -a yarn test
if: runner.os == 'Linux'
- run: yarn test
if: runner.os == 'Windows'
- name: Upload coverage to Codecov
if: runner.os == 'macOs'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
semantic-release:
name: "Release"
runs-on: ubuntu-latest
needs: ["test"]
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
steps:
- name: "Checkout"
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: bahmutov/npm-install@v1
with:
useRollingCache: true
install-command: yarn --frozen-lockfile
- name: "Build package"
run: yarn build
- name: "Release"
id: "release"
uses: codfish/semantic-release-action@v2.2.0
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}