Merge dd15424d16
into 036c0dcd18
This commit is contained in:
commit
c078d95d57
|
@ -10,6 +10,7 @@ jobs:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ]
|
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ]
|
||||||
|
mode: [ 'root', 'rootless' ]
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
|
@ -19,22 +20,50 @@ jobs:
|
||||||
options: --privileged --cgroupns=host
|
options: --privileged --cgroupns=host
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install dependencies
|
- name: Setup root/rootless
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
|
if [ "${{ matrix.mode }}" = "rootless" ]; then
|
||||||
|
useradd -m myuser
|
||||||
|
echo "USER_EXEC_CMD=su myuser" >> $GITHUB_ENV
|
||||||
|
chown -R myuser:myuser .
|
||||||
|
else
|
||||||
|
echo USER_EXEC_CMD="/bin/bash" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y podman
|
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y podman
|
||||||
python -m pip install --upgrade pip
|
- name: Setup virtualenv
|
||||||
|
run: |
|
||||||
|
$USER_EXEC_CMD -c "
|
||||||
|
set -e
|
||||||
|
python3 -m venv .venv
|
||||||
|
. .venv/bin/activate
|
||||||
|
pip install --upgrade pip
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
pip install -r test-requirements.txt
|
pip install -r test-requirements.txt
|
||||||
|
"
|
||||||
- name: Run integration tests
|
- name: Run integration tests
|
||||||
run: |
|
run: |
|
||||||
|
$USER_EXEC_CMD -c "
|
||||||
|
set -e
|
||||||
|
. .venv/bin/activate
|
||||||
python -m unittest discover -v tests/integration
|
python -m unittest discover -v tests/integration
|
||||||
|
"
|
||||||
env:
|
env:
|
||||||
TESTS_DEBUG: 1
|
TESTS_DEBUG: 1
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
run: |
|
run: |
|
||||||
|
$USER_EXEC_CMD -c "
|
||||||
|
set -e
|
||||||
|
. .venv/bin/activate
|
||||||
coverage run --source podman_compose -m unittest discover tests/unit
|
coverage run --source podman_compose -m unittest discover tests/unit
|
||||||
|
"
|
||||||
- name: Report coverage
|
- name: Report coverage
|
||||||
run: |
|
run: |
|
||||||
|
$USER_EXEC_CMD -c "
|
||||||
|
set -e
|
||||||
|
. .venv/bin/activate
|
||||||
coverage combine
|
coverage combine
|
||||||
coverage report --format=markdown | tee -a $GITHUB_STEP_SUMMARY
|
coverage report --format=markdown | tee -a $GITHUB_STEP_SUMMARY
|
||||||
|
"
|
||||||
|
|
Loading…
Reference in New Issue