Skip to content

Commit

Permalink
ci: add future support for tiobe
Browse files Browse the repository at this point in the history
Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
  • Loading branch information
sergiusens committed Jul 29, 2024
1 parent e0eaee7 commit a97db08
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
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
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
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

0 comments on commit a97db08

Please sign in to comment.