From f9d76cf45015c7c8d40c75b53271437017f91830 Mon Sep 17 00:00:00 2001 From: Brendon Smith Date: Mon, 5 Jul 2021 15:05:17 -0400 Subject: [PATCH] Add Python 3.10 to GitHub Actions workflows Beta releases of Python 3.10 were installed with `"3.10.0-beta - 3.10"`. Python 3.10 is now stable, so beta versions are no longer needed. Python versions in YAML must now be quoted. `3.10` is interpreted as a float and becomes `3.1`, so `"3.10"` must be used instead. --- .github/workflows/builds.yml | 11 ++++++----- .github/workflows/hooks.yml | 2 +- .github/workflows/tests.yml | 3 ++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 464ab49..407b011 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.8, 3.9] + python-version: ["3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 @@ -60,12 +60,13 @@ jobs: - name: Run unit tests run: pytest --cov-report=xml - name: Upload test coverage report to Codecov + if: matrix.python-version == '3.10' uses: codecov/codecov-action@v2 with: fail_ci_if_error: true flags: unit - - name: Build Python package with latest Python version and publish to PyPI - if: startsWith(github.ref, 'refs/tags/') && matrix.python-version == 3.9 + - name: Build Python package with latest stable Python version and publish to PyPI + if: startsWith(github.ref, 'refs/tags/') && matrix.python-version == '3.10' run: poetry publish --build -u __token__ -p ${{ secrets.PYPI_TOKEN }} docker: runs-on: ubuntu-latest @@ -73,7 +74,7 @@ jobs: strategy: matrix: linux-version: ["", "alpine", "slim"] - python-version: [3.8, 3.9] + python-version: ["3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 @@ -188,7 +189,7 @@ jobs: -u ${{ github.actor }} --password-stdin - name: Tag and push Docker images with latest tags if: > - matrix.python-version == 3.9 && + matrix.python-version == '3.10' && ( startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/develop' || diff --git a/.github/workflows/hooks.yml b/.github/workflows/hooks.yml index 2904d7c..dbcd368 100644 --- a/.github/workflows/hooks.yml +++ b/.github/workflows/hooks.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.8, 3.9] + python-version: ["3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2308193..3964229 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.8, 3.9] + python-version: ["3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 @@ -53,6 +53,7 @@ jobs: - name: Run unit tests run: pytest --cov-report=xml - name: Upload test coverage report to Codecov + if: matrix.python-version == '3.10' uses: codecov/codecov-action@v2 with: fail_ci_if_error: true