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: add support for tiobe #1769

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

on:
push:
branches:
- main
# to easy test changes to the workflow
- tiobe

jobs:
CI:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- 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 python3 python3-dev libapt-pkg-dev libyaml-dev
echo "::endgroup::"
echo "::group::pip install"
python -m pip install 'tox<5.0' tox-gh
echo "::endgroup::"

eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
brew install skopeo

- name: Setup Tox environment
run: tox --workdir /tmp/tox run-parallel --parallel auto --parallel-no-spinner --parallel-live --colored yes -e test-py3.10 --notest

- name: Test with tox
run: |
echo "::group::skopeo"
# From tests.yaml
# Ensure the version of skopeo comes from homebrew
# This is only necessary until we move to noble.
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
# Allow skopeo to access the contents of /run/containers
sudo chmod 777 /run/containers
# Add an xdg runtime dir for skopeo to look into for an auth.json file
sudo mkdir -p /run/user/$(id -u)
sudo chown $USER /run/user/$(id -u)
export XDG_RUNTIME_DIR=/run/user/$(id -u)
echo "::endgroup::"

tox --workdir /tmp/tox run --skip-pkg-install --no-list-dependencies --result-json results/tox-py310.json --colored yes -e test-py3.10

- name: Upload test results
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: test-results-ubuntu-22.04
path: results/

- name: Run TICS analysis
uses: tiobe/tics-github-action@v3
env:
PATH: "/tmp/tox/test-py3.10/bin:/snap/bin:/home/runner/.local/bin:/home/runner/.cargo/bin:/bin:/usr/bin:/usr/local/bin:"
with:
mode: qserver
project: charmcraft
viewerUrl: https://canonical.tiobe.com/tiobeweb/TICS/api/cfg?name=default
branchdir: ${{ github.workspace }}
ticsAuthToken: ${{ secrets.TICSAUTHTOKEN }}
installTics: true
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ dev = [ # When updating these, also update the dev/lint/types groups in renovat
"hypothesis",
"pydocstyle",
"pyfakefs",
"pylint",
"pytest",
"pytest-cov",
"pytest-mock",
Expand Down Expand Up @@ -122,7 +123,7 @@ line-length = 99

[tool.codespell]
ignore-words-list = "buildd,crate,keyserver,comandos,ro,dedent,dedented,tread,socio-economic"
skip = ".tox,.git,build,.*_cache,__pycache__,*.tar,*.snap,*.png,./node_modules,./docs/_build,.direnv,.venv,venv,.vscode,charmcraft.spec"
skip = "requirements*.txt,.tox,.git,build,.*_cache,__pycache__,*.tar,*.snap,*.png,./node_modules,./docs/_build,.direnv,.venv,venv,.vscode,charmcraft.spec"
quiet-level = 3
check-filenames = true

Expand Down
5 changes: 5 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
astroid==3.2.4
attrs==23.2.0
certifi==2024.7.4
cffi==1.16.0
Expand All @@ -13,6 +14,7 @@ craft-providers==1.24.1
craft-store==2.6.2
cryptography==42.0.8
Deprecated==1.2.14
dill==0.3.8
distro==1.9.0
docker==7.1.0
flake8==7.0.0
Expand All @@ -23,6 +25,7 @@ hypothesis==6.100.5
idna==3.7
importlib_metadata==7.1.0
iniconfig==2.0.0
isort==5.13.2
jaraco.classes==3.4.0
jeepney==0.8.0
Jinja2==3.1.4
Expand Down Expand Up @@ -50,6 +53,7 @@ pydocstyle==6.3.0
pyfakefs==5.4.1
pyflakes==3.2.0
pygit2==1.14.1
pylint==3.2.6
sergiusens marked this conversation as resolved.
Show resolved Hide resolved
pymacaroons==0.13.0
PyNaCl==1.5.0
pyparsing==3.1.2
Expand All @@ -76,6 +80,7 @@ snap-helpers==0.4.2
snowballstemmer==2.2.0
sortedcontainers==2.4.0
tabulate==0.9.0
tomlkit==0.13.0
types-Deprecated==1.2.9.20240311
types-PyYAML==6.0.12.20240311
typing_extensions==4.11.0
Expand Down
Loading