-
Notifications
You must be signed in to change notification settings - Fork 760
46 lines (42 loc) · 1.2 KB
/
_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
name: _ Run Tests
on:
workflow_call:
inputs:
use-devnet:
type: boolean
default: false
ignore-scripts:
type: boolean
default: false
secrets:
TEST_RPC_URL:
required: false
TEST_ACCOUNT_PRIVATE_KEY:
required: false
TEST_ACCOUNT_ADDRESS:
required: false
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
# TODO - periodically check if conditional services are supported; https://github.com/actions/runner/issues/822
services:
devnet:
image: ${{ (inputs.use-devnet) && 'shardlabs/starknet-devnet-rs:0.2.4' || '' }}
ports:
- 5050:5050
env:
TEST_RPC_URL: ${{ secrets.TEST_RPC_URL }}
TEST_ACCOUNT_PRIVATE_KEY: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY }}
TEST_ACCOUNT_ADDRESS: ${{ secrets.TEST_ACCOUNT_ADDRESS }}
steps:
- run: echo ${{ secrets.TEST_RPC_URL }}
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'npm'
- run: npm ci --ignore-scripts
- run: npm run pretest && npm run posttest
if: ${{ !inputs.ignore-scripts }}
- run: npm run test:coverage