-
Notifications
You must be signed in to change notification settings - Fork 219
120 lines (96 loc) · 2.88 KB
/
acvm-test.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
name: Test acvm_js
on: [push, pull_request]
# This will cancel previous runs when a branch or PR is updated
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }}
cancel-in-progress: true
jobs:
build-acvm-js-package:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-22.11
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v12
with:
name: barretenberg
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Build acvm-js
working-directory: acvm-repo
run: |
nix build .#
- name: Dereference symlink
working-directory: acvm-repo
run: echo "UPLOAD_PATH=$(readlink -f result)" >> $GITHUB_ENV
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: acvm-js
path: ${{ env.UPLOAD_PATH }}
retention-days: 3
test-acvm_js-node:
needs: [build-acvm-js-package]
name: Node.js Tests
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: acvm-js
path: ./acvm-repo/result
- name: Set up test environment
uses: ./.github/actions/setup
with:
working-directory: ./acvm-repo/acvm_js
- name: Run node tests
working-directory: ./acvm-repo/acvm_js
run: |
yarn
yarn test
test-acvm_js-browser:
needs: [build-acvm-js-package]
name: Browser Tests
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: acvm-js
path: ./acvm-repo/result
- name: Set up test environment
uses: ./.github/actions/setup
with:
working-directory: ./acvm-repo/acvm_js
- name: Install playwright deps
working-directory: ./acvm-repo/acvm_js
run: |
npx playwright install
npx playwright install-deps
- name: Run browser tests
working-directory: ./acvm-repo/acvm_js
run: |
yarn
yarn test:browser
test-acvm_js-rust:
name: Rust Tests
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.66.0
with:
targets: wasm32-unknown-unknown
- uses: taiki-e/install-action@v2
with:
tool: wasm-bindgen-cli@0.2.87
- name: Run rust tests
working-directory: acvm-repo
run: cargo test