diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d65dd41..c9b22a4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,6 +19,8 @@ jobs: fail-fast: false matrix: python_version: ["3.9"] + container_engine: + - podman repo_type: # Only test a subset of the repo2docker tests since we're testing podman, # not the full repo2docker functionality @@ -33,6 +35,19 @@ jobs: # - r - unit - venv/default + include: + - python_version: "3.11" + container_engine: docker + repo_type: base + - python_version: "3.11" + container_engine: docker + repo_type: venv/default + - python_version: "3.11" + container_engine: nerdctl + repo_type: base + - python_version: "3.11" + container_engine: nerdctl + repo_type: venv/default steps: - name: Checkout repo @@ -67,7 +82,9 @@ jobs: done - name: Run tests - run: pytest -v tests/${{ matrix.repo_type }} + run: | + export CONTAINER_ENGINE=${{ matrix.container_engine }} + pytest -v tests/${{ matrix.repo_type }} # https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ publish-pypi: diff --git a/tests/conftest.py b/tests/conftest.py index bc128bb..21f54a0 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -19,6 +19,9 @@ from repo2docker.__main__ import make_r2d +CONTAINER_EXECUTABLE = os.getenv("CONTAINER_EXECUTABLE") + + def pytest_collect_file(parent, path): if path.basename == "verify": return LocalRepo.from_parent(parent, fspath=path) @@ -99,9 +102,10 @@ def collect(self): args = [ "--appendix", 'RUN echo "appendix" > /tmp/appendix', - "--engine", - "podman", + "--engine=podman", ] + if CONTAINER_EXECUTABLE: + args.append(f"--PodmanEngine.podman_executable={CONTAINER_EXECUTABLE}") # If there's an extra-args.yaml file in a test dir, assume it contains # a yaml list with extra arguments to be passed to repo2docker extra_args_path = os.path.join(self.fspath.dirname, "extra-args.yaml")