Skip to content

Commit c59d395

Browse files
ehildenbrv-auditor
authored andcommitted
Run CI on normal github runners, not ephemeral. The required status checks need to be updated. --------- Co-authored-by: devops <[email protected]>
1 parent 9ab99ef commit c59d395

File tree

5 files changed

+68
-39
lines changed

5 files changed

+68
-39
lines changed

pyk/.github/workflows/test-pr.yml

Lines changed: 62 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -71,57 +71,86 @@ jobs:
7171
profile:
7272
needs: code-quality-checks
7373
name: 'Profiling'
74-
runs-on: [self-hosted, linux, normal-ephemeral]
74+
runs-on: [self-hosted, linux, normal]
7575
timeout-minutes: 10
76+
strategy:
77+
matrix:
78+
python-version: ['3.10']
7679
steps:
7780
- name: 'Check out code'
7881
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'
86106
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()
94111
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
97113
98114
integration-tests:
99115
needs: code-quality-checks
100116
name: 'Integration Tests'
101-
runs-on: [self-hosted, linux, normal-ephemeral]
117+
runs-on: [self-hosted, linux, normal]
102118
timeout-minutes: 30
103119
strategy:
104120
matrix:
105121
python-version: ['3.10', '3.11']
106122
steps:
107123
- name: 'Check out code'
108124
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()
116152
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
125154
126155
build-on-nix:
127156
needs: code-quality-checks

pyk/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/usr python3 -
1717

1818
ARG USER_ID=9876
1919
ARG GROUP_ID=9876
20-
RUN groupadd -g $GROUP_ID user \
21-
&& useradd -m -u $USER_ID -s /bin/sh -g user user
20+
RUN groupadd -g ${GROUP_ID} user \
21+
&& useradd -m -u ${USER_ID} -s /bin/sh -g user user

pyk/docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
project = 'pyk'
1010
author = 'Runtime Verification, Inc'
1111
copyright = '2024, Runtime Verification, Inc'
12-
version = '0.1.651'
13-
release = '0.1.651'
12+
version = '0.1.652'
13+
release = '0.1.652'
1414

1515
# -- General configuration ---------------------------------------------------
1616
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

pyk/package/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.651
1+
0.1.652

pyk/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
66
name = "pyk"
7-
version = "0.1.651"
7+
version = "0.1.652"
88
description = ""
99
authors = [
1010
"Runtime Verification, Inc. <[email protected]>",

0 commit comments

Comments
 (0)