-
-
Notifications
You must be signed in to change notification settings - Fork 377
118 lines (106 loc) 路 3.7 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
112
113
114
115
116
117
118
name: ci
on:
push:
branches: main
env:
CI: true
PNPM_CACHE_FOLDER: .pnpm-store
NX_CLOUD_DISTRIBUTED_EXECUTION: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: checkout code repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: setup node.js
uses: actions/setup-node@v3
with:
node-version: 15.x
- name: install pnpm
run: npm i pnpm@6 -g
- name: load cache
uses: actions/cache@v3
with:
path: |
./.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}
- name: setup pnpm config
run: pnpm config set store-dir $PNPM_CACHE_FOLDER
- name: install dependencies
run: pnpm install
- run: pnpx nx-cloud start-ci-run
- name: build packs
run: pnpm build:cache
- name: run test
run: |
pnpm test
- name: run cypress
uses: cypress-io/github-action@v2
with:
install: false
start: pnpm start --filter=@milkdown/e2e
command: pnpm test --filter=@milkdown/e2e
wait-on: 'http://localhost:7000'
browser: chrome
- name: create versions or publish to npm registry
uses: changesets/action@v1
with:
publish: pnpm release
commit: 'ci(changeset): release milkdown'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# - name: deploy to pages
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: docs
- run: pnpx nx-cloud stop-all-agents
if: ${{ always() }}
- name: export screenshots (on failure only)
uses: actions/upload-artifact@v3.0.0
if: ${{ failure() }}
with:
name: cypress-screenshots
path: tests/cypress/screenshots
retention-days: 7
- name: export screen recordings (on failure only)
uses: actions/upload-artifact@v3.0.0
if: ${{ failure() }}
with:
name: cypress-videos
path: tests/cypress/videos
retention-days: 7
agents:
runs-on: ubuntu-latest
name: Agent
timeout-minutes: 60
strategy:
matrix:
agent: [1, 2, 3]
steps:
- uses: actions/checkout@v3
- name: setup node.js
uses: actions/setup-node@v3
with:
node-version: 15.x
- name: install pnpm
run: npm i pnpm@6 -g
- name: load cache
uses: actions/cache@v3
with:
path: |
./.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}
- name: setup pnpm config
run: pnpm config set store-dir $PNPM_CACHE_FOLDER
- name: install dependencies
run: pnpm install
- name: Start Nx Agent ${{ matrix.agent }}
run: npx nx-cloud start-agent