Skip to content

Commit

Permalink
fix: use pipx and virtual environments for CI actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jedel1043 authored and NucciTheBoss committed Oct 11, 2024
1 parent cc8ac43 commit 9aee46d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 15 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
jobs:
inclusive-naming-check:
name: Inclusive naming check
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -34,34 +34,34 @@ jobs:

lint:
name: Lint
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: python3 -m pip install tox
run: pipx install tox
- name: Run linters
run: tox run -e lint

unit-test:
name: Unit tests
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: python3 -m pip install tox
run: pipx install tox
- name: Run tests
run: tox run -e unit

type-check:
name: Static type checking
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: python3 -m pip install tox
run: pipx install tox
- name: Run tests
run: tox run -e type

Expand All @@ -72,7 +72,7 @@ jobs:
bases:
- [email protected]
name: Integration tests (LXD) | ${{ matrix.bases }}
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- inclusive-naming-check
- lint
Expand All @@ -81,6 +81,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: pipx install tox
- name: Setup operator environment
uses: charmed-kubernetes/actions-operator@main
with:
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/nightly-TICS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,23 @@ permissions:

jobs:
TICS:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
- name: Install requirements
run: |
python3 -m pip install tox pylint flake8
python3 -m pip install --requirement test-requirements.txt
sudo apt update -y
sudo apt install python3-venv -y
- name: Create and activate virtual environment
run: |
python3 -m venv .venv
. .venv/bin/activate
pip install tox pylint flake8 pytest pyyaml
pip install --requirement test-requirements.txt
echo PATH=$PATH >> $GITHUB_ENV
- name: Run coverage tests
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
name: Release to CharmHub
needs:
- ci-tests
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
strategy:
fail-fast: true
matrix:
Expand All @@ -38,8 +38,8 @@ jobs:
- name: Select charmhub channel
uses: canonical/charming-actions/[email protected]
id: channel
- name: Install dependencies
run: python3 -m pip install tox
- name: Install tox
run: pipx install tox
- name: Stage charm
run: tox run -e stage -- ${{ matrix.charm }} --clean
- name: Upload charm to charmhub
Expand Down

0 comments on commit 9aee46d

Please sign in to comment.