-
Notifications
You must be signed in to change notification settings - Fork 32
94 lines (87 loc) · 2.67 KB
/
ci.yaml
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
name: CI
on:
pull_request:
env:
STARKNET_RPC: http://localhost:5050
DEVNET_DUMP_PATH: /devnet-dump.json
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: flutter-actions/setup-flutter@v3
with:
channel: stable
version: 3.19.5
cache: true
cache-sdk: true
- uses: bluefireteam/melos-action@v3
- run: melos bootstrap
- run: melos format:check
- run: melos analyze
test-unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: flutter-actions/setup-flutter@v3
with:
channel: stable
version: 3.19.5
cache: true
cache-sdk: true
- uses: bluefireteam/melos-action@v3
- run: melos bootstrap
- run: melos test:dart:unit
test-integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: flutter-actions/setup-flutter@v3
with:
channel: stable
version: 3.19.5
cache: true
cache-sdk: true
- uses: bluefireteam/melos-action@v3
- run: melos bootstrap
- name: Retrieve starknet devnet version
shell: bash
run: |
grep STARKNET_DEVNET_VERSION .env.devnet | sed 's|export ||g' >> $GITHUB_ENV
- name: Run starknet-devnet as a background process
run: |
docker run -d --name starknet-devnet \
-v ${{ github.workspace }}/assets/devnet-dump.json:$DEVNET_DUMP_PATH \
-p 5050:5050 \
--entrypoint tini \
shardlabs/starknet-devnet-rs:$STARKNET_DEVNET_VERSION -- \
starknet-devnet --host 0.0.0.0 --seed 0 --dump-path $DEVNET_DUMP_PATH --state-archive-capacity full
sleep 3 # Wait for 3 seconds for the Docker container to initialize
- run: melos test:dart:integration
- name: Cleanup
if: always()
run: docker stop starknet-devnet && docker rm starknet-devnet
# - name: Setup SSH if failure
# if: failure()
# uses: lhotari/action-upterm@v1
check-contracts-changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check for changes
uses: dorny/paths-filter@v3
id: changes
with:
filters: |
contracts_dir:
- 'contracts/v2.6.2/**'
- uses: flutter-actions/setup-flutter@v3
with:
channel: stable
version: 3.19.5
cache: true
cache-sdk: true
- uses: bluefireteam/melos-action@v3
- name: Run scarb check
if: steps.changes.outputs.contracts_dir == 'true'
run: melos test:dart:unit