Make Container, DerivedContainer & Pod inherit from ParameterSet #680
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
--- | |
name: CI | |
on: | |
push: | |
branches: | |
- "main" | |
pull_request: | |
jobs: | |
format: | |
name: Ensure code is properly formatted | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.tox | |
key: tox-${{ hashFiles('tox.ini') }}-${{ hashFiles('setup.cfg') }}-${{ hashFiles('test-requirements.txt') }} | |
- run: pip install tox | |
- run: tox -e format -- --check | |
ci: | |
name: Run the integration tests | |
runs-on: ${{ matrix.os_version }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | |
container_runtime: ["podman", "docker"] | |
without_buildah: [ false ] | |
os_version: ["ubuntu-latest"] | |
include: | |
# include python 3.7 on ubuntu 22.04 | |
- container_runtime: "podman" | |
python_version: "3.7" | |
without_buildah: false | |
os_version: "ubuntu-22.04" | |
- container_runtime: "docker" | |
python_version: "3.7" | |
without_buildah: false | |
os_version: "ubuntu-22.04" | |
# also test without buildah, but only on the latest python | |
- python_version: "3.13" | |
container_runtime: "podman" | |
without_buildah: true | |
os_version: "ubuntu-latest" | |
# and test python3.6 on ubuntu 20.04 | |
- python_version: "3.6" | |
container_runtime: "podman" | |
without_buildah: false | |
os_version: "ubuntu-20.04" | |
- python_version: "3.6" | |
container_runtime: "docker" | |
without_buildah: false | |
os_version: "ubuntu-20.04" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python_version }} | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.tox | |
key: tox-${{ hashFiles('tox.ini') }}-${{ hashFiles('setup.cfg') }}-${{ hashFiles('test-requirements.txt') }} | |
- run: pip install tox | |
- name: remove buildah | |
if: ${{ matrix.without_buildah }} | |
run: | | |
sudo apt-get remove buildah | |
! command -v buildah | |
- run: | | |
export CUR_USER="$(whoami)" | |
sudo loginctl enable-linger ${CUR_USER} | |
- run: | | |
mkdir ./tmp/ | |
chmod 1777 ./tmp | |
export TMPDIR="$(pwd)/tmp" | |
export PULL_ALWAYS=0 | |
export CONTAINER_RUNTIME=${{ matrix.container_runtime }} | |
export TOXPYTHON=$pythonLocation | |
tox -e py$(echo $PY_VER | tr -d . ) -- -x -n auto --reruns 3 | |
export PULL_ALWAYS=1 | |
tox -e py$(echo $PY_VER | tr -d . ) -- -x -n auto --reruns 3 --pytest-container-log-level DEBUG | |
tox -e py$(echo $PY_VER | tr -d . ) -- -x --reruns 3 --pytest-container-log-level DEBUG | |
unset TOXPYTHON | |
tox -e coverage | |
env: | |
PY_VER: ${{ matrix.python_version }} | |
- name: verify that no stray containers are left | |
run: | | |
[[ $(${{ matrix.container_runtime }} ps -aq|wc -l) = '0' ]] || (${{ matrix.container_runtime }} ps -aq|xargs ${{ matrix.container_runtime }} inspect; exit 1) | |
- name: verify that no stray volumes are left | |
run: | | |
[[ $(${{ matrix.container_runtime }} volume ls -q|wc -l) = "0" ]] | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
build: | |
name: Build the package | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: install setuptools | |
run: pip install setuptools | |
- name: Run the build | |
run: python setup.py sdist bdist_wheel | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: wheel | |
path: dist/pytest_container*whl | |
if-no-files-found: error | |
install: | |
name: Install the package | |
runs-on: ${{ matrix.os_version }} | |
needs: build | |
strategy: | |
fail-fast: false | |
matrix: | |
os_version: ["ubuntu-latest"] | |
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | |
include: | |
- os_version: "ubuntu-22.04" | |
python_version: "3.7" | |
- os_version: "ubuntu-20.04" | |
python_version: "3.6" | |
steps: | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python_version }} | |
- uses: actions/download-artifact@v4 | |
with: | |
name: wheel | |
path: dist | |
- name: install the wheel | |
run: pip install --user dist/pytest_container*whl | |
- name: run a smoke test that the package has been installed | |
run: python -c "import pytest_container; print (pytest_container.__name__)" | |
documentation: | |
name: Build the documentation | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.tox | |
key: tox-${{ hashFiles('tox.ini') }}-${{ hashFiles('setup.cfg') }}-${{ hashFiles('test-requirements.txt') }} | |
- run: pip install tox | |
- run: tox -e doc | |
- name: upload the build directory | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build | |
path: ./build/html | |
deploy: | |
name: deploy to the gh-pages branch | |
runs-on: ubuntu-latest | |
needs: documentation | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: build | |
path: ./build | |
- run: touch ./build/.nojekyll | |
- name: deploy to github pages | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: gh-pages | |
folder: build | |
lint: | |
name: Lint the source code | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.tox | |
key: tox-${{ hashFiles('tox.ini') }}-${{ hashFiles('setup.cfg') }}-${{ hashFiles('test-requirements.txt') }} | |
- run: pip install tox | |
# grab the previously built wheel for checking with twine | |
- uses: actions/download-artifact@v4 | |
with: | |
name: wheel | |
path: dist | |
- run: tox -e lint |