Skip to content

Commit

Permalink
ci: run setup-python before actions-operator to fix tox install
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
james-garner-canonical committed Oct 9, 2024
1 parent 1f5d361 commit 2679d84
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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]
Expand Down

0 comments on commit 2679d84

Please sign in to comment.