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

ci: fix CI pipeline and add TiCS analysis action #45

Merged
merged 2 commits 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
14 changes: 7 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,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 @@ -20,29 +20,29 @@ 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 -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 -e unit

integration-test:
name: Integration tests
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- inclusive-naming-check
- lint
Expand All @@ -51,7 +51,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: python3 -m pip install tox
run: pipx install tox
- name: Set up LXD
uses: canonical/[email protected]
with:
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/nightly-TICS.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Nightly TICS scan

on:
schedule:
- cron: '03 05 * * *' # Every day at 05:03 UTC
workflow_dispatch:

permissions:
contents: read

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

- name: Install requirements
run: |
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
pip install --requirement requirements.txt
pip install --requirement dev-requirements.txt
echo PATH=$PATH >> $GITHUB_ENV

- name: Run coverage tests
run: |
tox -e unit

- name: TICS GitHub Action
uses: tiobe/tics-github-action@v3
with:
mode: qserver
project: hpc-libs
viewerUrl: https://canonical.tiobe.com/tiobeweb/TICS/api/cfg?name=default
branchdir: ${{ env.GITHUB_WORKSPACE }}
ticsAuthToken: ${{ secrets.TICS_AUTH_TOKEN }}
installTics: true
calc: ALL
2 changes: 1 addition & 1 deletion .github/workflows/release-libs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

release-to-charmhub:
name: Release latest version of libraries to Charmhub
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- ci
steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ __pycache__/
*.py[cod]
.idea
.vscode/
cover
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ commands =
{posargs} \
{[vars]tests_path}/unit
coverage report
coverage xml -o cover/coverage.xml

[testenv:static]
description = Run static type checks
Expand Down