-
Notifications
You must be signed in to change notification settings - Fork 24
92 lines (73 loc) · 2.26 KB
/
js-projects.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
name: Run tests in JS projects
on:
workflow_call:
env:
CI: true
FORCE_COLOR: true
jobs:
matrix:
runs-on: ubuntu-latest
outputs:
matrix: "${{ steps.changed.outputs.all_changed_files }}"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Get changed files
id: changed
uses: tj-actions/changed-files@v35
with:
files: |
quickstart/1-browser-to-browser
quickstart/2-browser-parallel-computation
js-client-examples/hello-world
js-client-examples/browser-example
js-client-examples/node-example
aqua-examples/echo-greeter/client-peer
aqua-examples/price-oracle/client-peer
aqua-examples/price-oracle/web
aqua-examples/aqua-ipfs-integration
dir_names: true
json: true
json_raw_format: true
- name: Print matrix
run: |
echo '${{ steps.changed.outputs.all_changed_files }}' | jq
test:
runs-on: ubuntu-latest
needs: matrix
strategy:
fail-fast: false
matrix:
dir: ${{ fromJSON(needs.matrix.outputs.matrix) }}
defaults:
run:
working-directory: ${{ matrix.dir }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2022-06-27
target: wasm32-wasi
- name: Setup marine
uses: fluencelabs/setup-marine@v1
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: "16"
registry-url: "https://registry.npmjs.org"
cache-dependency-path: "${{ matrix.dir }}/package-lock.json"
- run: npm i
- run: npm run build
- name: Run tests
if: matrix.dir != 'aqua-examples/aqua-ipfs-integration'
run: npm run test
- name: Run aqua-ipfs-integration tests for web
if: matrix.dir == 'aqua-examples/aqua-ipfs-integration'
run: npm run test -w web
- name: Run aqua-ipfs-integration tests for nodejs
if: matrix.dir == 'aqua-examples/aqua-ipfs-integration'
run: npm run test -w nodejs