-
Notifications
You must be signed in to change notification settings - Fork 6
63 lines (53 loc) · 1.44 KB
/
cicd.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
name: CI/CD
on:
push:
branches:
- main
pull_request:
branches:
- main
types:
- opened
- reopened
- synchronize
jobs:
test_build_release:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [19]
env:
CI: true
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js and yarn
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
cache-dependency-path: 'yarn.lock'
- name: Get yarn cache directory path
id: yarn-cache-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- name: Cache yarn packages
id: yarn-cache
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-path.outputs.dir }}
key: node-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }}
restore-keys: |
node-${{ matrix.node-version }}-yarn-
- name: Install dependencies
run: yarn install --immutable
- name: Lint
run: yarn lint
- name: Test
run: yarn test
- name: Build
run: yarn build
# semantic-release will only run on pushes to main (see package.json)
# - name: Release
# run: yarn semantic-release
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}