Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use pipx and virtual environments for CI actions #33

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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