-
Notifications
You must be signed in to change notification settings - Fork 48
104 lines (103 loc) · 2.42 KB
/
ci.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
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
#
# ci.yml
#
# Run tests for all pushed commits and opened pull requests on Github.
#
name: CI
on: [push, pull_request]
jobs:
ci:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
node: [18]
steps:
- name: Set up NodeJS
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Git checkout
uses: actions/checkout@v2
- name: NPM ci, build, & test
run: |
npm ci
npm run build --if-present
npm run test
cd templates/project-ts
npm install || true
npm run test
env:
CI: true
sudoku-example:
runs-on: ubuntu-latest
strategy:
matrix:
node: [18]
steps:
- name: Set up NodeJS
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Git checkout
uses: actions/checkout@v2
- name: NPM ci, build, & test
run: |
npm ci
npm run build --if-present
npm link
zk example sudoku
cd sudoku
npm run test
npm run build
npm run start
env:
CI: true
tictactoe-example:
runs-on: ubuntu-latest
strategy:
matrix:
node: [18]
steps:
- name: Set up NodeJS
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Git checkout
uses: actions/checkout@v2
- name: NPM ci, build, & test
run: |
npm ci
npm run build --if-present
npm link
zk example tictactoe
cd tictactoe
npm run test
npm run build
npm run start
env:
CI: true
publish:
runs-on: ubuntu-latest
needs: [ci, sudoku-example, tictactoe-example]
strategy:
matrix:
node: [18]
steps:
- name: Set up NodeJS
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Git checkout
uses: actions/checkout@v2
- name: NPM ci & build
run: |
npm ci
npm run build --if-present
- name: Publish to NPM if version has changed
uses: JS-DevTools/npm-publish@v1
if: github.ref == 'refs/heads/main'
with:
token: ${{ secrets.NPM_TOKEN }}
env:
INPUT_TOKEN: ${{ secrets.NPM_TOKEN }}