-
Notifications
You must be signed in to change notification settings - Fork 1
198 lines (186 loc) · 5.55 KB
/
e2e.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
name: Main
on:
pull_request:
push:
branches:
- main
tags:
- "v*.*.*"
jobs:
build-wasm:
name: Build DNA
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Install nix
uses: cachix/install-nix-action@v27
with:
install_url: https://releases.nixos.org/nix/nix-2.23.3/install
extra_nix_config: |
experimental-features = flakes nix-command
- uses: cachix/cachix-action@v15
with:
name: holochain-ci
- name: Set up Rust cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: holoom-dna-${{ hashFiles('**/Cargo.lock') }}
- name: Build DNA
run: |
nix develop --command \
npm run build:dna
- uses: actions/upload-artifact@v4
with:
name: happ_workdir
path: workdir
retention-days: 1
build-packages:
runs-on: ubuntu-20.04
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20.12.2"
cache: "npm"
- name: Setup node dependency cache
uses: actions/cache@v4
with:
path: "**/node_modules"
key: node_modules-${{ hashFiles('**/package-lock.json')}}
- run: npm i
- run: npm run -w @holoom/types build
- run: npm run -w @holoom/client build
- run: npm run -w @holoom/authority build
- run: npm run -w @holoom/sandbox build
- uses: actions/upload-artifact@v4
with:
name: types-dist
path: packages/types/dist
retention-days: 1
- uses: actions/upload-artifact@v4
with:
name: client-dist
path: packages/client/dist
retention-days: 1
- uses: actions/upload-artifact@v4
with:
name: authority-dist
path: packages/authority/dist
retention-days: 1
- uses: actions/upload-artifact@v4
with:
name: sandbox-dist
path: packages/sandbox/dist
retention-days: 1
tryorama-tests:
name: Tryorama Tests
runs-on: ubuntu-20.04
needs:
- build-wasm
- build-packages
strategy:
fail-fast: false
matrix:
shard: [1/6, 2/6, 3/6, 4/6, 5/6, 6/6]
steps:
- uses: actions/checkout@v4
- name: Install nix
uses: cachix/install-nix-action@v27
with:
install_url: https://releases.nixos.org/nix/nix-2.23.3/install
extra_nix_config: |
experimental-features = flakes nix-command
- uses: cachix/cachix-action@v15
with:
name: holochain-ci
- run: rm -rf workdir
- name: Download DNA
uses: actions/download-artifact@v4
with:
name: happ_workdir
path: workdir
- uses: actions/download-artifact@v4
with:
name: types-dist
path: packages/types/dist
- uses: actions/download-artifact@v4
with:
name: client-dist
path: packages/client/dist
- uses: actions/download-artifact@v4
with:
name: authority-dist
path: packages/authority/dist
- name: Setup node dependency cache
uses: actions/cache@v4
with:
path: "**/node_modules"
key: node_modules-${{ hashFiles('**/package-lock.json')}}
- run: |
nix develop --command bash -c \
"npm i -w @holoom/tryorama && TRYORAMA_LOG_LEVEL=error npx -w @holoom/tryorama vitest run --shard ${{ matrix.shard }}"
release:
name: Publish release artefacts
if: startsWith(github.ref, 'refs/tags/v')
needs:
- tryorama-tests
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download happ_workdir
uses: actions/download-artifact@v4
with:
name: happ_workdir
path: happ_workdir
- name: Move DNA
run: mv happ_workdir/holoom.dna ./holoom.dna
- uses: actions/download-artifact@v4
with:
name: types-dist
path: packages/types/dist
- uses: actions/download-artifact@v4
with:
name: client-dist
path: packages/client/dist
- uses: actions/download-artifact@v4
with:
name: authority-dist
path: packages/authority/dist
- uses: actions/download-artifact@v4
with:
name: sandbox-dist
path: packages/sandbox/dist
- name: Release binaries
uses: softprops/action-gh-release@v2
with:
files: |
holoom.dna
- uses: actions/setup-node@v4
with:
node-version: "20.12.2"
registry-url: "https://registry.npmjs.org"
- name: Publish types to npm
run: npm publish --access public -w @holoom/types
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish client to npm
run: npm publish --access public -w @holoom/client
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish authority to npm
run: npm publish --access public -w @holoom/authority
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish sandbox to npm
run: npm publish --access public -w @holoom/sandbox
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}