-
-
Notifications
You must be signed in to change notification settings - Fork 3
117 lines (113 loc) · 3.35 KB
/
tests.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
name: Tests
on:
push:
paths-ignore:
- 'docs/**'
- '*.md'
branches:
- main
- release/**
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'
branches:
- main
- release/**
jobs:
test-units:
runs-on: ubuntu-latest
name: 🧪 Contract unit tests
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v4
- name: ⏬ Install Zenroom
run: |
wget https://github.com/dyne/zenroom/releases/latest/download/zenroom -O zenroom
chmod +x zenroom
cp zenroom test/
- name: 💾 Clone W3C-DID-data in data
run: |
rm -rf data
git clone https://github.com/dyne/W3C-DID-data.git data
- name: 🧪 Run tests
run: |
make test-units
restroom_job:
runs-on: ubuntu-latest
name: 🔬 API integration tests
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v4
- name: ⏬ Install Zenroom
run: |
wget https://github.com/dyne/zenroom/releases/latest/download/zenroom -O zenroom
chmod +x zenroom
sudo cp zenroom /usr/local/bin/zenroom
- name: ⏬ Install restroom-test
run: |
wget https://github.com/dyne/zencode-tools/releases/latest/download/restroom-test -O restroom-test
chmod +x restroom-test
- name: 💾 Clone W3C-DID-data in data
run: |
rm -rf data
git clone https://github.com/dyne/W3C-DID-data.git data
- name: 🗝️ Create server keys
run: |
cp test/restroom/test_keyring.json secrets/blockchains_client.json
cd restroom
mv .env.example .env
npm ci && npm run init
- name: 🛫 Start restroom
uses: dyne/restroom-github-action@v1
with:
restroom-contracts: "${{ github.workspace }}/api"
restroom-files: "${{ github.workspace }}/"
restroom-logger: "${{ github.workspace }}/"
- name: 🧪 Run tests
run: |
sleep 10
echo "SANDBOX"
./test/restroom/run.sh sandbox
echo ""
echo "IFACER"
./test/restroom/run.sh ifacer
mylog=`cat api_dyne_v1.log`
if [ "$mylog" = "" ]; then
echo ""
echo "empty log"
exit 1
fi
js-build-check:
name: 🐯 js build & checks
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
env:
SANDBOX_TEST_ADMIN_KEYRING: ${{secrets.SANDBOX_TEST_ADMIN_KEYRING}}
defaults:
run:
working-directory: bindings/javascript
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v4
- name: ⚙️ Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: ⏬ Install dependencies
run: npm ci
- name: 🏗️ Build javascript bindings
run: npm run build
- name: ⏫ Upload artifact
if: ${{ matrix.node-version == '16.x' }}
uses: actions/upload-artifact@v3
with:
name: javascript-artifact
path: |
./bindings/javascript/package.json
./bindings/javascript/README.md
./bindings/javascript/dist/
- name: 🧪 Test bindings node-${{ matrix.node-version }}
run: npm test