-
Notifications
You must be signed in to change notification settings - Fork 25
173 lines (137 loc) · 4.48 KB
/
ci.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
161
162
163
164
165
166
167
168
169
170
171
172
173
name: CI
on: [push, pull_request]
jobs:
test-linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.13", "pypy3.10"]
include:
- python-version: 3.9
coverage: "--cov=rebench"
name: "Ubuntu-latest: Python ${{ matrix.python-version }}"
steps:
- name: Checkout ReBench
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install PyTest
run: pip install pytest
- name: Install coverage and coveralls
run: pip install pytest-cov coveralls
if: matrix.coverage
- name: Install ReBench dependencies
run: pip install --editable .
- name: Run tests
run: |
pytest ${{ matrix.coverage }}
(cd rebench && rebench ../rebench.conf e:TestRunner2)
- name: Install and run pylint
run: |
pip install pylint
pylint rebench
if: matrix.python-version == '3.13'
- name: Install and run black
run: |
pip install black
black --check rebench
if: matrix.python-version == '3.13'
- name: Install and run mypy
run: |
pip install mypy
mypy --install-types --non-interactive rebench
if: matrix.python-version == '3.13'
- name: Upload coverage results to Coveralls
run: coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
if: ${{ matrix.coverage && env.COVERALLS_REPO_TOKEN != '' }}
test-macos:
runs-on: macos-latest
name: "macOS: Python 3.12"
steps:
- name: Checkout ReBench
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install PyTest
run: pip install pytest
- name: Install ReBench dependencies
run: pip install .
- name: Run tests
run: |
python -m pytest
(cd rebench && rebench ../rebench.conf e:TestRunner2)
test-docker:
name: "Docker: python:3"
runs-on: ubuntu-latest
container:
image: python:3
steps:
- name: Check for dockerenv file
run: (ls /.dockerenv && echo Found dockerenv) || (echo No dockerenv)
- name: Install Time Command
run: |
apt-get update
apt-get install -y --no-install-recommends time
- name: Checkout ReBench
uses: actions/checkout@v4
- name: Install PyTest
run: pip3 install pytest
- name: Install ReBench dependencies
run: pip3 install .
- name: Run Test Run
run: (cd rebench && rebench -D ../rebench.conf e:TestRunner2)
- name: Run Unit Tests
run: python3 -m pytest
test-rocky:
name: "Rocky Linux: Python 3.9"
runs-on: ubuntu-latest
container:
image: rockylinux/rockylinux:9
steps:
- name: Checkout ReBench
uses: actions/checkout@v4
- name: Install basic tools
run: dnf install -y which time sudo python3-pip
- name: Run Tests and Package in venv
run: |
python3 -m pip install virtualenv
python3 -m virtualenv venv
source venv/bin/activate
pip install pytest
pip install .
pytest
(cd rebench && rebench -D ../rebench.conf e:TestRunner2)
python3 setup.py sdist build
python3 setup.py sdist bdist_wheel
- name: Install built package globally
run: pip install dist/*.whl
- name: Run integration test
run: |
set +e
cd rebench
rebench -c ../rebench.conf e:TestRunner2
REBENCH_EXIT=$?
echo "rebench exit code: $REBENCH_EXIT"
if [ "$REBENCH_EXIT" -ne "0" ]; then
echo "rebench failed unexpectedly"
exit $REBENCH_EXIT
fi
if [ ! -f test.data ]; then
echo "test.data not found"
exit 1
fi
EXPECTED=80
LINES=$(cat test.data | grep total | wc -l)
if [ "$LINES" -ne "$EXPECTED" ]; then
echo "test.data has unexpected number of lines: $LINES"
echo "expected: $EXPECTED"
exit 1
fi