From 2679d84f3867f8f9a0054ab280978f89dcd8fc6a Mon Sep 17 00:00:00 2001 From: James Garner Date: Thu, 10 Oct 2024 10:55:18 +1300 Subject: [PATCH 1/3] ci: run setup-python before actions-operator to fix tox install Github's rollout of 24.04 for ubuntu-latest has now reached python-libjuju, so `pip install tox` no longer works -- 24.04 prevents installing packages using pip. This causes an error with in 'Setup operator environment' using charmed-kubernetes/actions-operator@main. The fix is to run our 'Setup Python' step using actions/setup-python before actions-operator instead of after. Since this takes care of installing tox, we can remove pip install tox for the jobs using these steps. Also bump setup-python to v5 for integration-quarantine, matching the recent PR bumping the version for other jobs. --- .github/workflows/test.yaml | 20 ++++++++------------ tox.ini | 1 + 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index cf0871c2..b966d5c4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -79,6 +79,10 @@ jobs: steps: - name: Check out code uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} - name: Setup operator environment uses: charmed-kubernetes/actions-operator@main with: @@ -112,12 +116,6 @@ jobs: # # set model defaults # juju model-defaults apt-http-proxy=$PROXY apt-https-proxy=$PROXY juju-http-proxy=$PROXY juju-https-proxy=$PROXY snap-http-proxy=$PROXY snap-https-proxy=$PROXY # juju model-defaults - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python }} - - name: Install dependencies - run: pip install tox - name: Run integration # Force one single concurrent test run: tox -e integration @@ -134,16 +132,14 @@ jobs: steps: - name: Check out code uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} - name: Setup operator environment uses: charmed-kubernetes/actions-operator@main with: provider: lxd juju-channel: 3.4/stable - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - - name: Install dependencies - run: pip install tox - name: Run integration run: tox -e integration-quarantine diff --git a/tox.ini b/tox.ini index 3f76f492..c9e1079a 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,7 @@ # Tox (http://tox.testrun.org/) is a tool for running tests # in multiple virtualenvs. This configuration file will run the # test suite on all supported python versions. To use it, "pip install tox" +# (pre ubuntu 24.04 -- otherwise consider using pipx or apt instead of pip) # and then run "tox" from this directory. [tox] From 5eabac42258dfa547a87238fc5095c2a637955e4 Mon Sep 17 00:00:00 2001 From: James Garner Date: Thu, 10 Oct 2024 11:56:05 +1300 Subject: [PATCH 2/3] ci: actually bump the version as described --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b966d5c4..bbd7fdd3 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -133,7 +133,7 @@ jobs: - name: Check out code uses: actions/checkout@v3 - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - name: Setup operator environment From a4ce7ad0ca01f43f1c5edf63370c56ade5471356 Mon Sep 17 00:00:00 2001 From: James Garner Date: Thu, 10 Oct 2024 11:57:20 +1300 Subject: [PATCH 3/3] ci: apply the same fix to candidate and edge testing actions --- .github/workflows/test_candidate.yaml | 13 +++++-------- .github/workflows/test_edge.yaml | 13 +++++-------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test_candidate.yaml b/.github/workflows/test_candidate.yaml index 5b87cdb4..078bbe7c 100644 --- a/.github/workflows/test_candidate.yaml +++ b/.github/workflows/test_candidate.yaml @@ -49,20 +49,17 @@ jobs: - name: Check out code uses: actions/checkout@v4 if: ${{ env.next-test != 'NA' }} - - name: Setup operator environment - if: ${{ env.next-test != 'NA' }} - uses: charmed-kubernetes/actions-operator@main - with: - provider: lxd - juju-channel: 3.4/candidate - name: Setup Python if: ${{ env.next-test != 'NA' }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - - name: Install dependencies + - name: Setup operator environment if: ${{ env.next-test != 'NA' }} - run: pip install tox + uses: charmed-kubernetes/actions-operator@main + with: + provider: lxd + juju-channel: 3.4/candidate - name: Run integration if: ${{ env.next-test != 'NA' }} # Force one single concurrent test diff --git a/.github/workflows/test_edge.yaml b/.github/workflows/test_edge.yaml index 37fb262d..2e5afaa7 100644 --- a/.github/workflows/test_edge.yaml +++ b/.github/workflows/test_edge.yaml @@ -49,20 +49,17 @@ jobs: - name: Check out code uses: actions/checkout@v4 if: ${{ env.next-test != 'NA' }} - - name: Setup operator environment - if: ${{ env.next-test != 'NA' }} - uses: charmed-kubernetes/actions-operator@main - with: - provider: lxd - juju-channel: 3.4/edge - name: Setup Python if: ${{ env.next-test != 'NA' }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - - name: Install dependencies + - name: Setup operator environment if: ${{ env.next-test != 'NA' }} - run: pip install tox + uses: charmed-kubernetes/actions-operator@main + with: + provider: lxd + juju-channel: 3.4/edge - name: Run integration if: ${{ env.next-test != 'NA' }} # Force one single concurrent test