-
Notifications
You must be signed in to change notification settings - Fork 4
137 lines (125 loc) · 5.42 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
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
name: 'Test'
on:
pull_request:
branches:
- 'master'
# Stop in progress workflows on the same branch and same workflow to use latest committed code
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
version-bump:
name: 'Version Bump'
runs-on: ubuntu-latest
steps:
- name: 'Check out code'
uses: actions/[email protected]
with:
token: ${{ secrets.JENKINS_GITHUB_PAT }}
# fetch-depth 0 means deep clone the repo
fetch-depth: 0
- name: 'Update Version'
run: |
set -x
git config user.name devops
git config user.email [email protected]
./package/version.sh bump $(git show origin/${GITHUB_BASE_REF}:package/version)
./package/version.sh sub
if git add --update && git commit --message "Set Version: $(cat package/version)"; then
git push origin HEAD:${GITHUB_HEAD_REF}
fi
build-nix:
name: 'Nix / Build'
strategy:
matrix:
include:
- runner: ubuntu-latest
os: ubuntu-latest
- runner: macos-12
os: macos-12
- runner: MacM1
os: self-macos-12
runs-on: ${{ matrix.runner }}
needs: version-bump
steps:
- name: 'Check out code'
uses: actions/[email protected]
- name: 'Install Nix/Cachix'
if: ${{ !startsWith(matrix.os, 'self') }}
uses: cachix/install-nix-action@v22
with:
install_url: https://releases.nixos.org/nix/nix-2.13.3/install
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v12
if: ${{ !startsWith(matrix.os, 'self') }}
with:
name: k-framework
authToken: ${{ secrets.CACHIX_PUBLIC_TOKEN }}
skipPush: true
- name: 'Build via Nix'
run: GC_DONT_GC=1 nix build .#kavm --print-build-logs
test-pr:
name: 'Test PR'
runs-on: [self-hosted, linux, normal]
needs: version-bump
steps:
- name: 'Check out code'
uses: actions/[email protected]
with:
submodules: recursive
- name: 'Set up Docker'
run: |
set -euxo pipefail
K_VERSION="$(cat deps/k_release)"
KAVM_COMMIT="$(git rev-parse --short=7 HEAD)"
docker build . \
--file Dockerfile \
--build-arg K_VERSION=${K_VERSION} \
--tag runtimeverification/avm-semantics-ci:${KAVM_COMMIT}
docker stop avm-semantics-ci || true && docker rm avm-semantics-ci || true
docker run \
--name avm-semantics-ci \
--rm \
--interactive \
--detach \
runtimeverification/avm-semantics-ci:${KAVM_COMMIT}
docker cp . avm-semantics-ci:/home/user
docker exec avm-semantics-ci chown -R user:user /home/user
- name: 'Check code style'
run: docker exec --user user --workdir /home/user -t avm-semantics-ci /bin/bash -c 'make check-kavm-codestyle'
- name: 'Build AVM semantics'
run: |
docker exec --user user --workdir /home/user -t avm-semantics-ci /bin/bash -c 'cd deps/plugin && make clean'
docker exec --user user --workdir /home/user -t avm-semantics-ci /bin/bash -c 'make build'
- name: 'Test Bison parsers '
run: |
docker exec --user user --workdir /home/user -t avm-semantics-ci /bin/bash -c 'make -j4 test-kavm-bison-parsers'
- name: 'Test AVM semantics --- scenarious'
run: |
docker exec --user user --workdir /home/user -t avm-semantics-ci /bin/bash -c 'THREADS=4 make test-kavm-avm-simulation'
- name: 'Test AVM semantics --- algod integration'
run: |
docker exec --user user --workdir /home/user -t avm-semantics-ci /bin/bash -c 'THREADS=4 make test-kavm-algod'
- name: 'Test AVM semantics --- proofs --- opcodes'
run: |
docker exec --user user --workdir /home/user -t avm-semantics-ci /bin/bash -c 'make -j4 test-avm-semantics-opcode-prove'
- name: 'Test AVM semantics --- proofs --- transactions'
run: |
docker exec --user user --workdir /home/user -t avm-semantics-ci /bin/bash -c 'make -j4 test-avm-semantics-transactions-prove'
- name: 'Test AVM semantics --- proofs --- app calls'
run: |
docker exec --user user --workdir /home/user -t avm-semantics-ci /bin/bash -c 'make -j4 test-avm-semantics-calls-prove'
# - name: 'Test AVM semantics --- proofs Pact CPMM'
# run: |
# docker exec --user user --workdir /home/user -t avm-semantics-ci /bin/bash -c 'make -j4 test-avm-semantics-pact-prove'
- name: 'Test AVM semantics --- proofs --- PyTeal generated'
run: |
docker exec --user user --workdir /home/user -t avm-semantics-ci /bin/bash -c 'THREADS=4 make test-pyteal-prove'
- name: 'Test AVM semantics --- KCFG proofs --- app calls'
run: |
docker exec --user user --workdir /home/user -t avm-semantics-ci /bin/bash -c 'make test-avm-semantics-calls-kcfg-prove'
- name: 'Tear down Docker'
if: always()
run: |
docker stop --time=0 avm-semantics-ci