From 41c32e643921ba4eadfa23bccfdb1642f2f2c321 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 16 Sep 2020 12:33:49 +0200 Subject: [PATCH] Support multiple architectures --- .github/workflows/this-repo.yml | 2 ++ README.md | 13 +++++++++++++ action.yaml | 6 +++++- pyproject.toml | 4 +++- 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/this-repo.yml b/.github/workflows/this-repo.yml index 33fed81..ff7605d 100644 --- a/.github/workflows/this-repo.yml +++ b/.github/workflows/this-repo.yml @@ -15,10 +15,12 @@ jobs: uses: ./ with: tox_env: ${{ matrix.tox_env }} + arch: ${{ matrix.arch }} dnf_install: ${{ matrix.dnf_install }} strategy: matrix: tox_env: [py39] + arch: [amd64, arm64, ppc64le, s390x] dnf_install: ["", "libffi-devel", "--enablerepo=updates-testing libffi-devel libyaml-devel"] # Use GitHub's Linux Docker host diff --git a/README.md b/README.md index c065187..2e000cb 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,19 @@ from your Tox configuration. (As far as we know, this is required in order to have individual environments show up as separate runs on GitHub. Discuss this limitation in [issue 8].) +Similarly, you can run tox on multiple architectures: + +```yaml +strategy: + matrix: + arch: [amd64, arm64, ppc64le, s390x] +... +- uses: fedora-python/tox-github-action + with: + tox_env: py38 + arch: ${{ matrix.arch }} +``` + You can also install RPM packages from Fedora by setting `dnf_install` to a space-separated list of *provides*, such as: diff --git a/action.yaml b/action.yaml index bd53f36..1113c74 100644 --- a/action.yaml +++ b/action.yaml @@ -5,13 +5,17 @@ inputs: required: true default: 'py38' description: Tox environment to run the tests on + arch: + required: false + default: 'amd64' + description: The architecture to run on (amd64 (default), arch64, ppc64le or s390x) dnf_install: required: false default: '' description: Space separated packages to install via dnf install (can contain options) runs: using: docker - image: docker://fedorapython/fedora-python-tox + image: docker://fedorapython/fedora-python-tox:${{ inputs.arch }} env: TOXENV: ${{ inputs.tox_env }} DNF_INSTALL: ${{ inputs.dnf_install }} diff --git a/pyproject.toml b/pyproject.toml index 2046c87..aa979ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,5 +10,7 @@ skipsdist = True [testenv] deps = pytest >= 3.0.0, <4 -commands = pytest test/test.py +commands = + python -m platform + pytest test/test.py """