@@ -71,57 +71,86 @@ jobs:
71
71
profile :
72
72
needs : code-quality-checks
73
73
name : ' Profiling'
74
- runs-on : [self-hosted, linux, normal-ephemeral ]
74
+ runs-on : [self-hosted, linux, normal]
75
75
timeout-minutes : 10
76
+ strategy :
77
+ matrix :
78
+ python-version : ['3.10']
76
79
steps :
77
80
- name : ' Check out code'
78
81
uses : actions/checkout@v3
79
- - name : ' Install Python'
80
- uses : actions/setup-python@v4
81
- with :
82
- python-version : ' 3.10'
83
- - name : ' Install Poetry'
84
- uses : Gr1N/setup-poetry@v8
85
- - name : ' Install K'
82
+ - name : ' Build Docker image'
83
+ run : |
84
+ COMMIT=$(git rev-parse --short=7 HEAD)
85
+ K_VERSION=$(cut --delim=v --field=2 deps/k_release)
86
+
87
+ docker build . \
88
+ --build-arg PYTHON_VERSION=${{ matrix.python-version }} \
89
+ --build-arg K_VERSION=${K_VERSION} \
90
+ --tag runtimeverificationinc/pyk-ci:${COMMIT}
91
+
92
+ docker run \
93
+ --name pyk-ci \
94
+ --rm \
95
+ --interactive \
96
+ --tty \
97
+ --detach \
98
+ --workdir /home/user \
99
+ runtimeverificationinc/pyk-ci:${COMMIT}
100
+
101
+ docker cp . pyk-ci:/home/user
102
+ docker exec pyk-ci chown -R user:user /home/user
103
+ - name : ' Set Python version'
104
+ run : docker exec --user user pyk-ci poetry env use ${{ matrix.python-version }}
105
+ - name : ' Build and run integration tests'
86
106
run : |
87
- K_VERSION=$(cat deps/k_release)
88
- DEB_PACKAGE_NAME=kframework_${K_VERSION}_amd64_ubuntu_jammy.deb
89
- wget https://github.com/runtimeverification/k/releases/download/v${K_VERSION}/${DEB_PACKAGE_NAME}
90
- sudo apt-get update
91
- sudo apt-get -y install ./${DEB_PACKAGE_NAME}
92
- kompile --version
93
- - name : ' Run profiling'
107
+ docker exec --user user pyk-ci make profile
108
+ docker exec --user user pyk-ci bash -c "find /tmp/pytest-of-${USER}/pytest-current/ -type f -name '*.prof' | sort | xargs tail -n +1"
109
+ - name : ' Tear down Docker container'
110
+ if : always()
94
111
run : |
95
- make profile
96
- find /tmp/pytest-of-${USER}/pytest-current/ -type f -name '*.prof' | sort | xargs tail -n +1
112
+ docker stop --time=0 pyk-ci
97
113
98
114
integration-tests :
99
115
needs : code-quality-checks
100
116
name : ' Integration Tests'
101
- runs-on : [self-hosted, linux, normal-ephemeral ]
117
+ runs-on : [self-hosted, linux, normal]
102
118
timeout-minutes : 30
103
119
strategy :
104
120
matrix :
105
121
python-version : ['3.10', '3.11']
106
122
steps :
107
123
- name : ' Check out code'
108
124
uses : actions/checkout@v3
109
- - name : ' Install Python'
110
- uses : actions/setup-python@v4
111
- with :
112
- python-version : ${{ matrix.python-version }}
113
- - name : ' Install Poetry'
114
- uses : Gr1N/setup-poetry@v8
115
- - name : ' Install K'
125
+ - name : ' Build Docker image'
126
+ run : |
127
+ COMMIT=$(git rev-parse --short=7 HEAD)
128
+ K_VERSION=$(cut --delim=v --field=2 deps/k_release)
129
+
130
+ docker build . \
131
+ --build-arg PYTHON_VERSION=${{ matrix.python-version }} \
132
+ --build-arg K_VERSION=${K_VERSION} \
133
+ --tag runtimeverificationinc/pyk-ci:${COMMIT}
134
+
135
+ docker run \
136
+ --name pyk-ci \
137
+ --rm \
138
+ --interactive \
139
+ --tty \
140
+ --detach \
141
+ --workdir /home/user \
142
+ runtimeverificationinc/pyk-ci:${COMMIT}
143
+
144
+ docker cp . pyk-ci:/home/user
145
+ docker exec pyk-ci chown -R user:user /home/user
146
+ - name : ' Set Python version'
147
+ run : docker exec --user user pyk-ci poetry env use ${{ matrix.python-version }}
148
+ - name : ' Build and run integration tests'
149
+ run : docker exec --user user pyk-ci make cov-integration COV_ARGS='-n8 --timeout 300'
150
+ - name : ' Tear down Docker container'
151
+ if : always()
116
152
run : |
117
- K_VERSION=$(cat deps/k_release)
118
- DEB_PACKAGE_NAME=kframework_${K_VERSION}_amd64_ubuntu_jammy.deb
119
- wget https://github.com/runtimeverification/k/releases/download/v${K_VERSION}/${DEB_PACKAGE_NAME}
120
- sudo apt-get update
121
- sudo apt-get -y install graphviz ./${DEB_PACKAGE_NAME}
122
- kompile --version
123
- - name : ' Run integration tests'
124
- run : make cov-integration COV_ARGS='-n8 --timeout 300'
153
+ docker stop --time=0 pyk-ci
125
154
126
155
build-on-nix :
127
156
needs : code-quality-checks
0 commit comments