2024-03-08 14:37:17 +01:00
|
|
|
name: Tests
|
2022-02-25 19:30:15 +01:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
2023-04-08 21:10:23 +02:00
|
|
|
test:
|
2022-02-25 19:30:15 +01:00
|
|
|
runs-on: ubuntu-latest
|
2024-03-08 10:51:01 +01:00
|
|
|
container:
|
|
|
|
image: docker.io/library/python:3.11-bookworm
|
|
|
|
# cgroupns needed to address the following error:
|
|
|
|
# write /sys/fs/cgroup/cgroup.subtree_control: operation not supported
|
|
|
|
options: --privileged --cgroupns=host
|
2022-02-25 19:30:15 +01:00
|
|
|
steps:
|
2022-10-17 17:15:57 +02:00
|
|
|
- uses: actions/checkout@v3
|
2022-02-25 19:30:15 +01:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2024-03-08 10:51:01 +01:00
|
|
|
set -e
|
|
|
|
apt update && apt install -y podman
|
2022-02-25 19:30:15 +01:00
|
|
|
python -m pip install --upgrade pip
|
|
|
|
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
2023-12-11 00:26:58 +01:00
|
|
|
if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi
|
2024-03-08 10:00:34 +01:00
|
|
|
- name: Test with unittest
|
2022-02-25 19:30:15 +01:00
|
|
|
run: |
|
2024-03-08 10:00:34 +01:00
|
|
|
coverage run --source podman_compose -m unittest pytests/*.py
|
|
|
|
python -m unittest tests/*.py
|
2023-12-11 00:26:58 +01:00
|
|
|
coverage combine
|
|
|
|
coverage report
|
2024-03-08 14:33:55 +01:00
|
|
|
env:
|
|
|
|
TESTS_DEBUG: 1
|