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: enable TiCS integration #4855

Merged
merged 2 commits into from
Jun 14, 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
40 changes: 40 additions & 0 deletions .github/workflows/tics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: TICS

on:
push:
branches:
- main

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

- name: Install dependencies
run: |
echo "::group::apt-get update"
sudo apt-get update
echo "::endgroup::"
echo "::group::apt-get install..."
sudo apt-get install -y libapt-pkg-dev libyaml-dev xdelta3 patchelf
echo "::endgroup::"
echo "::group::pip install"
python -m pip install 'tox<5.0' tox-gh
echo "::endgroup::"

- name: Setup Tox environment
run: tox run-parallel --parallel auto --parallel-no-spinner --parallel-live --colored yes -e test-all-py310 --notest

- name: Test with tox
run: tox run --skip-pkg-install --result-json results/tox-py310.json --colored yes -e test-all-py310

- name: Run TICS analysis
uses: tiobe/tics-github-action@v3
with:
mode: qserver
project: snapcraft
viewerUrl: https://canonical.tiobe.com/tiobeweb/TICS/api/cfg?name=default
ticsAuthToken: ${{ secrets.TICSAUTHTOKEN }}
installTics: true
8 changes: 8 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ commands =
pytest {tty:--color=yes} --cov=snapcraft --cov-report=xml:results/coverage-{env_name}.xml --junit-xml=results/test-results-{env_name}.xml tests/unit {posargs}
pytest {tty:--color=yes} --junit-xml=results/legacy-test-results-{env_name}.xml tests/legacy {posargs}

[testenv:test-all-py310]
base = testenv, test
description = Run all tests with the interpreter used in the snap
sergiusens marked this conversation as resolved.
Show resolved Hide resolved
allowlist_externals = mkdir
commands_pre = mkdir -p results
commands =
pytest {tty:--color=yes} --cov=snapcraft --cov-report=xml:results/coverage-{env_name}.xml --junit-xml=results/test-results-{env_name}.xml tests {posargs}

[lint] # Standard linting configuration
package = editable
extras = dev
Expand Down
Loading