From 27a3e9d9e7bda7ce488c5bc3ab4a9ff15259975c Mon Sep 17 00:00:00 2001 From: kp-cat <52385411+kp-cat@users.noreply.github.com> Date: Thu, 24 Apr 2025 11:00:25 +0200 Subject: [PATCH 1/2] CI fix: run older python versions in docker --- .github/workflows/python-ci.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml index cfef50d..ddecdf6 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,23 +58,26 @@ 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 From fe21e6a0b704a05ce49562959eabfe0e9aeb01c2 Mon Sep 17 00:00:00 2001 From: kp-cat <52385411+kp-cat@users.noreply.github.com> Date: Thu, 24 Apr 2025 11:44:20 +0200 Subject: [PATCH 2/2] github action CI: cleanup --- .github/workflows/python-ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml index ddecdf6..856acad 100644 --- a/.github/workflows/python-ci.yml +++ b/.github/workflows/python-ci.yml @@ -49,7 +49,7 @@ jobs: " - name: Set up Python ${{ matrix.python-version }} - if: ${{ ! (matrix.os == 'ubuntu-latest' && contains(fromJSON('["3.5","3.6","3.7"]'), 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 }} @@ -58,20 +58,20 @@ 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)) }} + 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)) }} + 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)) }} + if: ${{ !(matrix.os == 'ubuntu-latest' && contains(fromJSON('["3.5","3.6","3.7"]'), matrix.python-version)) }} run: pytest configcatclienttests @@ -80,6 +80,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Set up Python uses: actions/setup-python@v5 with: