-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (67 loc) · 2.1 KB
/
ci.yml
File metadata and controls
78 lines (67 loc) · 2.1 KB
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
name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
unit:
name: unit
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip
cache-dependency-path: sdk/pyproject.toml
- name: Install dependencies
working-directory: ./sdk
run: |
python -m pip install --upgrade pip
python -m pip install -e .[dev]
- name: Run unit tests
working-directory: ./sdk
run: pytest tests -m "not e2e"
e2e:
name: e2e
runs-on: ubuntu-latest
timeout-minutes: 20
env:
TRP_ENDPOINT_PREPROD: ${{ secrets.TRP_ENDPOINT_PREPROD }}
TRP_API_KEY_PREPROD: ${{ secrets.TRP_API_KEY_PREPROD }}
TEST_PARTY_A_ADDRESS: ${{ secrets.TEST_PARTY_A_ADDRESS }}
TEST_PARTY_A_MNEMONIC: ${{ secrets.TEST_PARTY_A_MNEMONIC }}
TEST_PARTY_B_ADDRESS: ${{ secrets.TEST_PARTY_B_ADDRESS }}
TEST_PARTY_B_MNEMONIC: ${{ secrets.TEST_PARTY_B_MNEMONIC }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip
cache-dependency-path: sdk/pyproject.toml
- name: Install dependencies
working-directory: ./sdk
run: |
python -m pip install --upgrade pip
python -m pip install -e .[dev]
- name: Validate e2e secrets
run: |
for name in TRP_ENDPOINT_PREPROD TRP_API_KEY_PREPROD TEST_PARTY_A_ADDRESS TEST_PARTY_A_MNEMONIC TEST_PARTY_B_ADDRESS TEST_PARTY_B_MNEMONIC; do
if [ -z "${!name}" ]; then
echo "Missing required e2e env var: $name"
exit 1
fi
done
- name: Run e2e tests
working-directory: ./sdk
run: pytest tests/e2e -m e2e