Skip to content

Commit 244e01b

Browse files
authored
Merge pull request #1152 from james-garner-canonical/24.10/ci/fix-24-04-tox
#1152 #### Description 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. #### QA Steps Tests no longer fail when trying to install `tox`, as they started doing in the last 12 hours. #### Notes Fix documented in charmed-kubernetes/actions-operator [here](charmed-kubernetes/actions-operator#82 (comment)).
2 parents 1f5d361 + a4ce7ad commit 244e01b

4 files changed

Lines changed: 19 additions & 28 deletions

File tree

.github/workflows/test.yaml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ jobs:
7979
steps:
8080
- name: Check out code
8181
uses: actions/checkout@v4
82+
- name: Setup Python
83+
uses: actions/setup-python@v5
84+
with:
85+
python-version: ${{ matrix.python }}
8286
- name: Setup operator environment
8387
uses: charmed-kubernetes/actions-operator@main
8488
with:
@@ -112,12 +116,6 @@ jobs:
112116
# # set model defaults
113117
# 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
114118
# juju model-defaults
115-
- name: Setup Python
116-
uses: actions/setup-python@v5
117-
with:
118-
python-version: ${{ matrix.python }}
119-
- name: Install dependencies
120-
run: pip install tox
121119
- name: Run integration
122120
# Force one single concurrent test
123121
run: tox -e integration
@@ -134,16 +132,14 @@ jobs:
134132
steps:
135133
- name: Check out code
136134
uses: actions/checkout@v3
135+
- name: Setup Python
136+
uses: actions/setup-python@v5
137+
with:
138+
python-version: ${{ matrix.python }}
137139
- name: Setup operator environment
138140
uses: charmed-kubernetes/actions-operator@main
139141
with:
140142
provider: lxd
141143
juju-channel: 3.4/stable
142-
- name: Setup Python
143-
uses: actions/setup-python@v4
144-
with:
145-
python-version: ${{ matrix.python }}
146-
- name: Install dependencies
147-
run: pip install tox
148144
- name: Run integration
149145
run: tox -e integration-quarantine

.github/workflows/test_candidate.yaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,17 @@ jobs:
4949
- name: Check out code
5050
uses: actions/checkout@v4
5151
if: ${{ env.next-test != 'NA' }}
52-
- name: Setup operator environment
53-
if: ${{ env.next-test != 'NA' }}
54-
uses: charmed-kubernetes/actions-operator@main
55-
with:
56-
provider: lxd
57-
juju-channel: 3.4/candidate
5852
- name: Setup Python
5953
if: ${{ env.next-test != 'NA' }}
6054
uses: actions/setup-python@v5
6155
with:
6256
python-version: ${{ matrix.python }}
63-
- name: Install dependencies
57+
- name: Setup operator environment
6458
if: ${{ env.next-test != 'NA' }}
65-
run: pip install tox
59+
uses: charmed-kubernetes/actions-operator@main
60+
with:
61+
provider: lxd
62+
juju-channel: 3.4/candidate
6663
- name: Run integration
6764
if: ${{ env.next-test != 'NA' }}
6865
# Force one single concurrent test

.github/workflows/test_edge.yaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,17 @@ jobs:
4949
- name: Check out code
5050
uses: actions/checkout@v4
5151
if: ${{ env.next-test != 'NA' }}
52-
- name: Setup operator environment
53-
if: ${{ env.next-test != 'NA' }}
54-
uses: charmed-kubernetes/actions-operator@main
55-
with:
56-
provider: lxd
57-
juju-channel: 3.4/edge
5852
- name: Setup Python
5953
if: ${{ env.next-test != 'NA' }}
6054
uses: actions/setup-python@v5
6155
with:
6256
python-version: ${{ matrix.python }}
63-
- name: Install dependencies
57+
- name: Setup operator environment
6458
if: ${{ env.next-test != 'NA' }}
65-
run: pip install tox
59+
uses: charmed-kubernetes/actions-operator@main
60+
with:
61+
provider: lxd
62+
juju-channel: 3.4/edge
6663
- name: Run integration
6764
if: ${{ env.next-test != 'NA' }}
6865
# Force one single concurrent test

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Tox (http://tox.testrun.org/) is a tool for running tests
22
# in multiple virtualenvs. This configuration file will run the
33
# test suite on all supported python versions. To use it, "pip install tox"
4+
# (pre ubuntu 24.04 -- otherwise consider using pipx or apt instead of pip)
45
# and then run "tox" from this directory.
56

67
[tox]

0 commit comments

Comments
 (0)