-
Notifications
You must be signed in to change notification settings - Fork 3
160 lines (155 loc) · 6.49 KB
/
test-pr.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: 'Run Tests'
on:
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
python-code-quality-checks:
name: 'Code Quality Checks'
runs-on: ubuntu-latest
steps:
- name: 'Check out code'
uses: actions/checkout@v3
with:
submodules: recursive
- name: 'Install Poetry'
uses: Gr1N/setup-poetry@v8
- name: 'Build and run code quality checks'
run: make -C kmultiversx check
simple-tests:
runs-on: [self-hosted, linux, normal]
name: 'Simple Tests'
needs: [python-code-quality-checks]
timeout-minutes: 30
steps:
- name: 'Check out code'
uses: actions/checkout@v3
with:
submodules: recursive
- name: 'Set up Docker'
uses: ./.github/actions/with-docker
with:
container-name: elrond-semantics-ci-${{ github.sha }}
- name: 'Build'
run: docker exec -t elrond-semantics-ci-${GITHUB_SHA} /bin/bash -c 'make build RELEASE=true -j4'
- name: 'Build Haskell'
run: docker exec -t elrond-semantics-ci-${GITHUB_SHA} /bin/bash -c 'make build-haskell RELEASE=true -j4'
- name: 'Install Kmultiversx'
run: docker exec -t elrond-semantics-ci-${GITHUB_SHA} /bin/bash -c 'make poetry-install'
- name: 'Run Python Unit Tests'
run: docker exec -t elrond-semantics-ci-${GITHUB_SHA} /bin/bash -c 'make TEST_CONCRETE_BACKEND=llvm unittest-python'
- name: 'Run Simple Test'
run: docker exec -t elrond-semantics-ci-${GITHUB_SHA} /bin/bash -c 'make TEST_CONCRETE_BACKEND=llvm test-simple -j6'
- name: 'Run Mandos Tests'
run: docker exec -t elrond-semantics-ci-${GITHUB_SHA} /bin/bash -c 'make TEST_CONCRETE_BACKEND=llvm mandos-test -j6'
- name: 'Tear down Docker'
if: always()
run: |
docker stop --time=0 elrond-semantics-ci-${GITHUB_SHA}
feature-tests:
runs-on: [self-hosted, linux, normal]
name: 'Feature Tests'
needs: [simple-tests]
timeout-minutes: 120
steps:
- name: 'Check out code'
uses: actions/checkout@v3
with:
submodules: recursive
- name: 'Set up Docker'
uses: ./.github/actions/with-docker
with:
container-name: elrond-semantics-ci-${{ github.sha }}
- name: 'Build'
run: docker exec -t elrond-semantics-ci-${GITHUB_SHA} /bin/bash -c 'make build RELEASE=true -j4'
- name: 'Install Kmultiversx'
run: docker exec -t elrond-semantics-ci-${GITHUB_SHA} /bin/bash -c 'make poetry-install'
- name: 'Run Basic Feature Test'
run: docker exec -t elrond-semantics-ci-${GITHUB_SHA} /bin/bash -c 'make TEST_CONCRETE_BACKEND=llvm test-elrond-basic-features -j6'
- name: 'Run Alloc Feature Test'
run: docker exec -t elrond-semantics-ci-${GITHUB_SHA} /bin/bash -c 'make TEST_CONCRETE_BACKEND=llvm test-elrond-alloc-features -j6'
- name: 'Tear down Docker'
if: always()
run: |
docker stop --time=0 elrond-semantics-ci-${GITHUB_SHA}
example-contract-tests:
runs-on: [self-hosted, linux, normal]
name: 'Example Contract Tests'
needs: [feature-tests]
timeout-minutes: 60
steps:
- name: 'Check out code'
uses: actions/checkout@v3
with:
submodules: recursive
- name: 'Set up Docker'
uses: ./.github/actions/with-docker
with:
container-name: elrond-semantics-ci-${{ github.sha }}
- name: 'Build'
run: docker exec -t elrond-semantics-ci-${GITHUB_SHA} /bin/bash -c 'make build RELEASE=true -j4'
- name: 'Install Kmultiversx'
run: docker exec -t elrond-semantics-ci-${GITHUB_SHA} /bin/bash -c 'make poetry-install'
- name: 'Run Adder Contract Test'
run: docker exec -t elrond-semantics-ci-${GITHUB_SHA} /bin/bash -c 'make TEST_CONCRETE_BACKEND=llvm test-elrond-adder'
- name: 'Run Crowdfunding ESDT Contract Test'
run: docker exec -t elrond-semantics-ci-${GITHUB_SHA} /bin/bash -c 'make TEST_CONCRETE_BACKEND=llvm test-elrond-crowdfunding-esdt'
- name: 'Run Multisig Contract Test'
run: docker exec -t elrond-semantics-ci-${GITHUB_SHA} /bin/bash -c 'make TEST_CONCRETE_BACKEND=llvm test-elrond-multisig'
- name: 'Tear down Docker'
if: always()
run: |
docker stop --time=0 elrond-semantics-ci-${GITHUB_SHA}
custom-contract-tests:
runs-on: [self-hosted, linux, normal]
name: 'Custom Contract Tests'
needs: [feature-tests]
timeout-minutes: 30
steps:
- name: 'Check out code'
uses: actions/checkout@v3
with:
submodules: recursive
- name: 'Set up Docker'
uses: ./.github/actions/with-docker
with:
container-name: elrond-semantics-ci-${{ github.sha }}
- name: 'Build'
run: docker exec -t elrond-semantics-ci-${GITHUB_SHA} /bin/bash -c 'make build RELEASE=true -j4'
- name: 'Install Kmultiversx'
run: docker exec -t elrond-semantics-ci-${GITHUB_SHA} /bin/bash -c 'make poetry-install'
- name: 'Run Custom Contract Tests'
run: docker exec -t elrond-semantics-ci-${GITHUB_SHA} /bin/bash -c 'make TEST_CONCRETE_BACKEND=llvm test-custom-contracts'
- name: 'Tear down Docker'
if: always()
run: |
docker stop --time=0 elrond-semantics-ci-${GITHUB_SHA}
kmultiversx-tests:
needs: simple-tests
name: 'KMultiversX Tests'
runs-on: [self-hosted, linux, normal]
steps:
- name: 'Check out code'
uses: actions/checkout@v3
with:
submodules: recursive
- name: 'Set up Docker'
uses: ./.github/actions/with-docker
with:
container-name: elrond-semantics-ci-${{ github.sha }}
- name: 'Build Kasmer'
run: docker exec -t elrond-semantics-ci-${GITHUB_SHA} /bin/bash -c 'make build-kasmer -j4'
- name: 'Install Kmultiversx'
run: docker exec -t elrond-semantics-ci-${GITHUB_SHA} /bin/bash -c 'make poetry-install'
- name: 'Run tests'
run: docker exec -t elrond-semantics-ci-${GITHUB_SHA} /bin/bash -c \
'make -C kmultiversx test TEST_ARGS="--kasmer-llvm-dir ../.build/defn/llvm/kasmer-kompiled/"'
- name: 'Run TestApi tests'
run: docker exec -t elrond-semantics-ci-${GITHUB_SHA} /bin/bash -c \
'make test-testapi'
- name: 'Tear down Docker'
if: always()
run: |
docker stop --time=0 elrond-semantics-ci-${GITHUB_SHA}