From 27e6832376cf8314b5292a9173ab7a707d3610d5 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Wed, 2 Nov 2022 14:27:11 +0100 Subject: [PATCH 1/5] Add check-latest to setup-python --- .github/workflows/ci.yaml | 5 +++++ .github/workflows/release.yml | 1 + 2 files changed, 6 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f924559ac..3ca28f1e4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -25,6 +25,7 @@ jobs: uses: actions/setup-python@v4.3.0 with: python-version: ${{ env.DEFAULT_PYTHON }} + check-latest: true - name: Generate partial Python venv restore key id: generate-python-key run: >- @@ -93,6 +94,7 @@ jobs: uses: actions/setup-python@v4.3.0 with: python-version: ${{ matrix.python-version }} + check-latest: true - name: Install Qt if: ${{ matrix.python-version == '3.10' }} run: | @@ -149,6 +151,7 @@ jobs: uses: actions/setup-python@v4.3.0 with: python-version: ${{ matrix.python-version }} + check-latest: true - name: Restore Python virtual environment id: cache-venv uses: actions/cache@v3.0.11 @@ -197,6 +200,7 @@ jobs: uses: actions/setup-python@v4.3.0 with: python-version: ${{ matrix.python-version }} + check-latest: true - name: Generate partial Python venv restore key id: generate-python-key run: >- @@ -242,6 +246,7 @@ jobs: uses: actions/setup-python@v4.3.0 with: python-version: ${{ matrix.python-version }} + check-latest: true - name: Generate partial Python venv restore key id: generate-python-key run: >- diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bcd91825b..a0157a19b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,6 +26,7 @@ jobs: uses: actions/setup-python@v4.3.0 with: python-version: ${{ env.DEFAULT_PYTHON }} + check-latest: true - name: Install requirements run: | # Remove dist, build, and astroid.egg-info From 50c596b8f2732245f2689db27fa20372b7295e8e Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Wed, 2 Nov 2022 14:23:36 +0100 Subject: [PATCH 2/5] Remove restore-keys --- .github/workflows/ci.yaml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3ca28f1e4..20ab33ef0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -41,8 +41,6 @@ jobs: key: >- ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ steps.generate-python-key.outputs.key }} - restore-keys: | - ${{ runner.os }}-${{ steps.python.outputs.python-version }}-base-venv-${{ env.CACHE_VERSION }}- - name: Create Python virtual environment if: steps.cache-venv.outputs.cache-hit != 'true' run: | @@ -63,8 +61,6 @@ jobs: path: ${{ env.PRE_COMMIT_CACHE }} key: >- ${{ runner.os }}-${{ steps.generate-pre-commit-key.outputs.key }} - restore-keys: | - ${{ runner.os }}-pre-commit-${{ env.CACHE_VERSION }}- - name: Install pre-commit dependencies if: steps.cache-precommit.outputs.cache-hit != 'true' run: | @@ -113,8 +109,6 @@ jobs: key: >- ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ steps.generate-python-key.outputs.key }} - restore-keys: | - ${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-${{ env.CACHE_VERSION }}- - name: Create Python virtual environment if: steps.cache-venv.outputs.cache-hit != 'true' run: | @@ -215,8 +209,6 @@ jobs: key: >- ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ steps.generate-python-key.outputs.key }} - restore-keys: | - ${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-${{ env.CACHE_VERSION }}- - name: Create Python virtual environment if: steps.cache-venv.outputs.cache-hit != 'true' run: | @@ -260,8 +252,6 @@ jobs: key: >- ${{ runner.os }}-${{ matrix.python-version }}-${{ steps.generate-python-key.outputs.key }} - restore-keys: | - ${{ runner.os }}-${{ matrix.python-version }}-venv-${{ env.CACHE_VERSION }}- - name: Create Python virtual environment if: steps.cache-venv.outputs.cache-hit != 'true' run: | From 15d0b2580bdb235e7b6ac9d71f2af1a6a6e00663 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Wed, 2 Nov 2022 14:22:02 +0100 Subject: [PATCH 3/5] Add KEY_PREFIX --- .github/workflows/ci.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 20ab33ef0..6979f495a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,6 +9,7 @@ on: env: CACHE_VERSION: 6 + KEY_PREFIX: venv DEFAULT_PYTHON: "3.10" PRE_COMMIT_CACHE: ~/.cache/pre-commit @@ -98,7 +99,7 @@ jobs: - name: Generate partial Python venv restore key id: generate-python-key run: >- - echo "key=venv-${{ env.CACHE_VERSION }}-${{ + echo "key=${{ env.KEY_PREFIX }}-${{ env.CACHE_VERSION }}-${{ hashFiles('setup.cfg', 'requirements_test.txt', 'requirements_test_min.txt', 'requirements_test_brain.txt') }}" >> $GITHUB_OUTPUT - name: Restore Python virtual environment @@ -198,7 +199,7 @@ jobs: - name: Generate partial Python venv restore key id: generate-python-key run: >- - echo "key=venv-${{ env.CACHE_VERSION }}-${{ + echo "key=${{ env.KEY_PREFIX }}-${{ env.CACHE_VERSION }}-${{ hashFiles('setup.cfg', 'requirements_test_min.txt', 'requirements_test_brain.txt') }}" >> $env:GITHUB_OUTPUT - name: Restore Python virtual environment @@ -242,7 +243,7 @@ jobs: - name: Generate partial Python venv restore key id: generate-python-key run: >- - echo "key=venv-${{ env.CACHE_VERSION }}-${{ + echo "key=${{ env.KEY_PREFIX }}-${{ env.CACHE_VERSION }}-${{ hashFiles('setup.cfg', 'requirements_test_min.txt') }}" >> $GITHUB_OUTPUT - name: Restore Python virtual environment id: cache-venv From 7d0b28be7dd4d1b30f3646ca221f21f10e8db620 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Wed, 2 Nov 2022 14:23:56 +0100 Subject: [PATCH 4/5] Misc --- .github/workflows/ci.yaml | 2 +- .github/workflows/release-tests.yml | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6979f495a..43783d3ed 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -8,7 +8,7 @@ on: pull_request: ~ env: - CACHE_VERSION: 6 + CACHE_VERSION: 1 KEY_PREFIX: venv DEFAULT_PYTHON: "3.10" PRE_COMMIT_CACHE: ~/.cache/pre-commit diff --git a/.github/workflows/release-tests.yml b/.github/workflows/release-tests.yml index 32fc1ea8c..8328eb991 100644 --- a/.github/workflows/release-tests.yml +++ b/.github/workflows/release-tests.yml @@ -2,9 +2,6 @@ name: Release tests on: workflow_dispatch -env: - DEFAULT_PYTHON: "3.10" - permissions: contents: read @@ -17,7 +14,7 @@ jobs: steps: - name: Check out code from GitHub uses: actions/checkout@v3.1.0 - - name: Set up Python + - name: Set up Python 3.9 id: python uses: actions/setup-python@v4.3.0 with: From e08a47ad7e2e4d3fe3e7b6cb87f745840ba08ff0 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Wed, 2 Nov 2022 14:31:22 +0100 Subject: [PATCH 5/5] Use pyproject.toml for hash --- .github/workflows/ci.yaml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 43783d3ed..36b0d0c2e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -31,9 +31,9 @@ jobs: id: generate-python-key run: >- echo "key=base-venv-${{ env.CACHE_VERSION }}-${{ - hashFiles('setup.cfg', 'requirements_test.txt', 'requirements_test_min.txt', - 'requirements_test_brain.txt', 'requirements_test_pre_commit.txt') }}" >> - $GITHUB_OUTPUT + hashFiles('pyproject.toml', 'requirements_test.txt', + 'requirements_test_min.txt', 'requirements_test_brain.txt', + 'requirements_test_pre_commit.txt') }}" >> $GITHUB_OUTPUT - name: Restore Python virtual environment id: cache-venv uses: actions/cache@v3.0.11 @@ -100,8 +100,9 @@ jobs: id: generate-python-key run: >- echo "key=${{ env.KEY_PREFIX }}-${{ env.CACHE_VERSION }}-${{ - hashFiles('setup.cfg', 'requirements_test.txt', 'requirements_test_min.txt', - 'requirements_test_brain.txt') }}" >> $GITHUB_OUTPUT + hashFiles('pyproject.toml', 'requirements_test.txt', + 'requirements_test_min.txt', 'requirements_test_brain.txt') }}" >> + $GITHUB_OUTPUT - name: Restore Python virtual environment id: cache-venv uses: actions/cache@v3.0.11 @@ -200,7 +201,7 @@ jobs: id: generate-python-key run: >- echo "key=${{ env.KEY_PREFIX }}-${{ env.CACHE_VERSION }}-${{ - hashFiles('setup.cfg', 'requirements_test_min.txt', + hashFiles('pyproject.toml', 'requirements_test_min.txt', 'requirements_test_brain.txt') }}" >> $env:GITHUB_OUTPUT - name: Restore Python virtual environment id: cache-venv @@ -244,7 +245,8 @@ jobs: id: generate-python-key run: >- echo "key=${{ env.KEY_PREFIX }}-${{ env.CACHE_VERSION }}-${{ - hashFiles('setup.cfg', 'requirements_test_min.txt') }}" >> $GITHUB_OUTPUT + hashFiles('pyproject.toml', 'requirements_test_min.txt') + }}" >> $GITHUB_OUTPUT - name: Restore Python virtual environment id: cache-venv uses: actions/cache@v3.0.11