Skip to content

Commit b528580

Browse files
authored
Merge pull request #1050 from o1-labs/feat/actions
Add Github Actions Testing to Examples
2 parents dc8d2ab + 185aa2a commit b528580

File tree

1 file changed

+30
-9
lines changed

1 file changed

+30
-9
lines changed

.github/workflows/test-tutorials.yml

+30-9
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,40 @@
11
name: Test-Tutorials
2-
32
on:
43
push:
4+
branches:
5+
- main
6+
workflow_dispatch: {}
57

68
jobs:
7-
hello-world:
9+
test-tutorials:
810
runs-on: ubuntu-latest
11+
12+
strategy:
13+
matrix:
14+
node-version: [18, 20, 22]
15+
example-path:
16+
- examples/zkapps/01-hello-world
17+
- examples/zkapps/02-private-inputs-and-hash-functions
18+
- examples/zkapps/05-common-types-and-functions
19+
- examples/zkapps/10-account-updates
20+
921
steps:
10-
- uses: actions/checkout@v2
11-
- uses: actions/setup-node@v3
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Setup Node.js
26+
uses: actions/setup-node@v4
1227
with:
13-
# In case of version change, update README.md accordingly
14-
node-version: 18
15-
- run: |
16-
npm ci
28+
node-version: ${{ matrix.node-version }}
29+
30+
- name: Set Git config (global)
31+
run: |
1732
git config --global user.email "[email protected]"
1833
git config --global user.name "Test"
19-
npx ts-node scripts/tutorial-runner.ts docs/zkapps/tutorials/01-hello-world.mdx
34+
35+
- name: Install dependencies, build and run ${{ matrix.example-path }}/build/src/main.js
36+
run: |
37+
cd ${{ matrix.example-path }}
38+
npm ci
39+
npm run build
40+
node build/src/main.js

0 commit comments

Comments
 (0)