diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml index cfef50d..856acad 100644 --- a/.github/workflows/python-ci.yml +++ b/.github/workflows/python-ci.yml @@ -18,7 +18,7 @@ jobs: strategy: matrix: python-version: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] - os: [ windows-latest, macos-latest, ubuntu-20.04 ] + os: [ windows-latest, macos-latest, ubuntu-latest ] exclude: # Python < v3.8 does not support Apple Silicon ARM64. - python-version: "3.5" os: macos-latest @@ -37,7 +37,19 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Run tests in Docker for legacy Python + if: matrix.os == 'ubuntu-latest' && contains(fromJSON('["3.5","3.6","3.7"]'), matrix.python-version) + run: | + docker run --rm -v ${{ github.workspace }}:/app -w /app python:${{ matrix.python-version }} bash -c " + pip install --upgrade pip && + pip install pytest pytest-cov parameterized mock flake8 && + pip install -r requirements.txt && + flake8 configcatclient --count --show-source --statistics && + pytest configcatclienttests + " + - name: Set up Python ${{ matrix.python-version }} + if: ${{ !(matrix.os == 'ubuntu-latest' && contains(fromJSON('["3.5","3.6","3.7"]'), matrix.python-version)) }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -46,25 +58,29 @@ jobs: PIP_TRUSTED_HOST: "pypi.python.org pypi.org files.pythonhosted.org" - name: Install dependencies + if: ${{ !(matrix.os == 'ubuntu-latest' && contains(fromJSON('["3.5","3.6","3.7"]'), matrix.python-version)) }} run: | python -m pip install --upgrade pip pip install pytest pytest-cov parameterized mock flake8 pip install -r requirements.txt - name: Lint with flake8 + if: ${{ !(matrix.os == 'ubuntu-latest' && contains(fromJSON('["3.5","3.6","3.7"]'), matrix.python-version)) }} run: | # Statical analysis flake8 configcatclient --count --show-source --statistics - name: Test + if: ${{ !(matrix.os == 'ubuntu-latest' && contains(fromJSON('["3.5","3.6","3.7"]'), matrix.python-version)) }} run: pytest configcatclienttests coverage: needs: [ test ] - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Set up Python uses: actions/setup-python@v5 with: