-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: refactor execution of Python tests
Previously we inconsistently used ubuntu-latest and ubuntu-20.04. We now pin that to the most recent compatible version to avoid floating refs (and the corresponding GitHub warning). As Python 3.6 and 3.7 is not supported on Ubuntu 24.04, we still execute them on 20.04 (officially EOL in April 2025). To reduce the test code duplication, we carve out the pytest execution into an action. Signed-off-by: Felix Moessbauer <[email protected]> Signed-off-by: Jan Kiszka <[email protected]>
- Loading branch information
1 parent
e858724
commit 5c51007
Showing
4 changed files
with
94 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: perform-tests | ||
inputs: | ||
python-version: | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
architecture: x64 | ||
- name: Install Python dependencies of kas and tests | ||
shell: bash | ||
run: | | ||
# install kas to have all kas dependencies: | ||
pip install . | ||
# test dependencies: | ||
pip install -U pytest | ||
- name: Install python-newt | ||
shell: bash | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install libpopt-dev libslang2-dev | ||
wget -q https://releases.pagure.org/newt/newt-$NEWT_VERSION.tar.gz | ||
echo "$NEWT_SHA256 newt-$NEWT_VERSION.tar.gz" | sha256sum -c | ||
tar -C /tmp -xzf newt-$NEWT_VERSION.tar.gz | ||
cd /tmp/newt-$NEWT_VERSION | ||
autoconf | ||
./configure --with-python=python${{ matrix.python-version }} | ||
make -j $(nproc) | ||
sudo make install | ||
ln -s /usr/local/lib/python${{ matrix.python-version }}/site-packages/_snack.so \ | ||
$(python3 -c 'import site; print(site.getsitepackages()[0])')/ | ||
ln -s /usr/local/lib/python${{ matrix.python-version }}/site-packages/snack.py \ | ||
$(python3 -c 'import site; print(site.getsitepackages()[0])')/ | ||
- name: Run offline tests | ||
shell: bash | ||
env: | ||
TERM: xterm | ||
http_proxy: http://0.0.0.0:8118 | ||
https_proxy: http://0.0.0.0:8118 | ||
run: pytest -m "not online" | ||
- name: Run online tests | ||
shell: bash | ||
env: | ||
TERM: xterm | ||
run: pytest -m "online" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters