-
Notifications
You must be signed in to change notification settings - Fork 207
111 lines (107 loc) · 3.24 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
105
106
107
108
109
110
111
name: 'CI'
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
unit-test:
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [16.14.0]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 7.6.0
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
# Set up GitHub Actions caching for Wireit.
- uses: google/wireit@setup-github-actions-caching/v1
- name: install dependency
run: pnpm install --filter=\!garfish-docs --filter=\!@garfish-dev/\*
- name: Run unit tests
run: pnpm run test:coverage
- name: Collect coverage
uses: codecov/codecov-action@v2
with:
directory: ./coverage
e2e-test:
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [16.14.0]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 7.6.0
run_install: false
# Set up GitHub Actions caching for Wireit.
- uses: google/wireit@setup-github-actions-caching/v1
- name: install dependency
run: pnpm install --filter=\!garfish-docs
- name: build
run: pnpm build
- name: update hard link
run: pnpm install --filter=\!garfish-docs
- name: Run cypress test
uses: cypress-io/github-action@v4
with:
install: false
start: node scripts/devCypress.js
wait-on: 'http://localhost:8090,http://localhost:8091,http://localhost:8092,http://localhost:8093,http://localhost:8094,http://localhost:8095,http://localhost:8096,http://localhost:8097'
wait-on-timeout: 600
parallel: true
record: true
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# Recommended: pass the GitHub token lets this action correctly
# determine the unique run id necessary to re-run the checks
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
type-check:
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [16.14.0]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 6.32.17
run_install: false
- name: install dependency
run: pnpm install --filter=\!garfish-docs
- name: check type
run: pnpm type:check