diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 41c384d..4539ee8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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 @@ -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 @@ -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/setup-lxd@v0.1.1 with: diff --git a/.github/workflows/nightly-TICS.yaml b/.github/workflows/nightly-TICS.yaml new file mode 100644 index 0000000..486e883 --- /dev/null +++ b/.github/workflows/nightly-TICS.yaml @@ -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 diff --git a/.github/workflows/release-libs.yaml b/.github/workflows/release-libs.yaml index 5b041bb..a96f579 100644 --- a/.github/workflows/release-libs.yaml +++ b/.github/workflows/release-libs.yaml @@ -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: diff --git a/.gitignore b/.gitignore index a26d707..6320e25 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ __pycache__/ *.py[cod] .idea .vscode/ +cover diff --git a/tox.ini b/tox.ini index 7dd5c44..0ee0a99 100644 --- a/tox.ini +++ b/tox.ini @@ -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