From 1467438dffebbbadf51a493cd098f80910502e14 Mon Sep 17 00:00:00 2001 From: Douglas Chiang Date: Thu, 19 Sep 2024 18:54:49 +0100 Subject: [PATCH 01/19] Add TiCS CI. Signed-off-by: Douglas Chiang --- .github/workflows/checkbox-tics.yml | 91 +++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 .github/workflows/checkbox-tics.yml diff --git a/.github/workflows/checkbox-tics.yml b/.github/workflows/checkbox-tics.yml new file mode 100644 index 0000000000..7cfa2f4590 --- /dev/null +++ b/.github/workflows/checkbox-tics.yml @@ -0,0 +1,91 @@ +name: TICS Code Quality Analysis + +on: + push: + branches: + - "main" + - "add-checkbox-tics" + workflow_dispatch: + +permissions: + contents: read + +jobs: + TICS: + runs-on: ubuntu-latest + environment: TICS + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: | + echo "::group::apt update" + sudo apt-get update + echo "::endgroup::" + echo "::group::apt install..." + sudo apt-get install -y libsystemd-dev python3-pip pylint flake8 + echo "::endgroup::" + + - name: Install Checkbox + run: | + sudo python -m pip install -e $PWD/checkbox-ng + sudo python -m pip install -e $PWD/checkbox-support + sudo python -m pip install psutil==5.9.5 opencv_python==4.8.0.76 natsort==8.0.2 libsvm==3.23.0.4 numpy==1.26.4 coverage==7.3.0 pytest + + - name: Run coverage tests + run: | + REPO_DIR="$PWD" + COVR_DIR="$PWD/.coverage" + + # Providers + echo "::group::coverage tests for providers..." + cd $REPO_DIR/providers/base + coverage run --append --branch --data-file=$COVR_DIR/.coverage manage.py test -u + cd $REPO_DIR/providers/certification-client + coverage run --append --branch --data-file=$COVR_DIR/.coverage manage.py test -u + cd $REPO_DIR/providers/certification-server + coverage run --append --branch --data-file=$COVR_DIR/.coverage manage.py test -u + cd $REPO_DIR/providers/docker + coverage run --append --branch --data-file=$COVR_DIR/.coverage manage.py test -u + cd $REPO_DIR/providers/genio + coverage run --append --branch --data-file=$COVR_DIR/.coverage manage.py test -u + cd $REPO_DIR/providers/gpgpu + coverage run --append --branch --data-file=$COVR_DIR/.coverage manage.py test -u + cd $REPO_DIR/providers/iiotg + coverage run --append --branch --data-file=$COVR_DIR/.coverage manage.py test -u + cd $REPO_DIR/providers/resource + coverage run --append --branch --data-file=$COVR_DIR/.coverage manage.py test -u + cd $REPO_DIR/providers/sru + coverage run --append --branch --data-file=$COVR_DIR/.coverage manage.py test -u + cd $REPO_DIR/providers/tpm2 + coverage run --append --branch --data-file=$COVR_DIR/.coverage manage.py test -u + cd $REPO_DIR/providers/tutorial + coverage run --append --branch --data-file=$COVR_DIR/.coverage manage.py test -u + cd $REPO_DIR + echo "::endgroup::" + + # Checkbox-ng + echo "::group::coverage tests for checkbox-ng..." + coverage run --append --branch --data-file=$COVR_DIR/.coverage -m pytest $PWD/checkbox-ng + echo "::endgroup::" + + # Checkbox-support + echo "::group::coverage tests for checkbox-support..." + coverage run --append --branch --data-file=$COVR_DIR/.coverage -m pytest $PWD/checkbox-support/checkbox_support/ + echo "::endgroup::" + + # Coverage report XML + echo "::group::coverage XML report..." + coverage xml -i --data-file $COVR_DIR/.coverage -o $COVR_DIR/cobertura.xml + echo "::endgroup::" + + - name: TICS GitHub Action + uses: tiobe/tics-github-action@v3 + with: + mode: qserver + project: checkbox + viewerUrl: https://canonical.tiobe.com/tiobeweb/TICS/api/cfg?name=default + branchdir: ${{ github.workspace }} + ticsAuthToken: ${{ secrets.TICSAUTHTOKEN }} + installTics: true + calc: ALL From ba201632a49f309a6266a582e2c952975b931d01 Mon Sep 17 00:00:00 2001 From: Douglas Chiang Date: Thu, 19 Sep 2024 19:01:07 +0100 Subject: [PATCH 02/19] Change branch name for testing. Signed-off-by: Douglas Chiang --- .github/workflows/checkbox-tics.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checkbox-tics.yml b/.github/workflows/checkbox-tics.yml index 7cfa2f4590..a0a42cbe1e 100644 --- a/.github/workflows/checkbox-tics.yml +++ b/.github/workflows/checkbox-tics.yml @@ -4,7 +4,7 @@ on: push: branches: - "main" - - "add-checkbox-tics" + - "add-checkbox-tiobe" workflow_dispatch: permissions: From a4f9d5568996ecc63ff190578b52cc45f3572dda Mon Sep 17 00:00:00 2001 From: Douglas Chiang Date: Fri, 20 Sep 2024 08:15:37 +0100 Subject: [PATCH 03/19] Turn to a cron job on main. Signed-off-by: Douglas Chiang --- .github/workflows/checkbox-tics.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/checkbox-tics.yml b/.github/workflows/checkbox-tics.yml index a0a42cbe1e..c0b14482b2 100644 --- a/.github/workflows/checkbox-tics.yml +++ b/.github/workflows/checkbox-tics.yml @@ -1,10 +1,8 @@ name: TICS Code Quality Analysis on: - push: - branches: - - "main" - - "add-checkbox-tiobe" + schedule: + - cron: '00 19 * * *' workflow_dispatch: permissions: @@ -16,6 +14,8 @@ jobs: environment: TICS steps: - uses: actions/checkout@v4 + with: + ref: main - name: Install dependencies run: | From a35e799dfc1eb5ee01d2aae4c7bac4360200546f Mon Sep 17 00:00:00 2001 From: Douglas Chiang Date: Thu, 26 Sep 2024 13:28:28 +0100 Subject: [PATCH 04/19] Fix dependencies for pytest. Signed-off-by: Douglas Chiang --- .github/workflows/checkbox-tics.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/checkbox-tics.yml b/.github/workflows/checkbox-tics.yml index c0b14482b2..53dd921027 100644 --- a/.github/workflows/checkbox-tics.yml +++ b/.github/workflows/checkbox-tics.yml @@ -1,8 +1,12 @@ name: TICS Code Quality Analysis on: - schedule: - - cron: '00 19 * * *' + push: + branches: + - "main" + - "add-checkbox-tiobe" + # schedule: + # - cron: '00 19 * * *' workflow_dispatch: permissions: @@ -14,8 +18,8 @@ jobs: environment: TICS steps: - uses: actions/checkout@v4 - with: - ref: main + # with: + # ref: main - name: Install dependencies run: | @@ -30,7 +34,7 @@ jobs: run: | sudo python -m pip install -e $PWD/checkbox-ng sudo python -m pip install -e $PWD/checkbox-support - sudo python -m pip install psutil==5.9.5 opencv_python==4.8.0.76 natsort==8.0.2 libsvm==3.23.0.4 numpy==1.26.4 coverage==7.3.0 pytest + sudo python -m pip install psutil==5.9.5 opencv_python==4.8.0.76 natsort==8.0.2 libsvm==3.23.0.4 numpy==1.26.4 coverage==7.3.0 urwid == 2.1.2 pynmea2 pytest - name: Run coverage tests run: | From c073aac8675994e9a29334d21462ec236ca7610d Mon Sep 17 00:00:00 2001 From: Douglas Chiang Date: Thu, 26 Sep 2024 13:30:56 +0100 Subject: [PATCH 05/19] Fix format. Signed-off-by: Douglas Chiang --- .github/workflows/checkbox-tics.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checkbox-tics.yml b/.github/workflows/checkbox-tics.yml index 53dd921027..dedbbb50cc 100644 --- a/.github/workflows/checkbox-tics.yml +++ b/.github/workflows/checkbox-tics.yml @@ -34,7 +34,7 @@ jobs: run: | sudo python -m pip install -e $PWD/checkbox-ng sudo python -m pip install -e $PWD/checkbox-support - sudo python -m pip install psutil==5.9.5 opencv_python==4.8.0.76 natsort==8.0.2 libsvm==3.23.0.4 numpy==1.26.4 coverage==7.3.0 urwid == 2.1.2 pynmea2 pytest + sudo python -m pip install psutil==5.9.5 opencv_python==4.8.0.76 natsort==8.0.2 libsvm==3.23.0.4 numpy==1.26.4 coverage==7.3.0 urwid==2.1.2 pynmea2 pytest - name: Run coverage tests run: | From a6aebd63a64a6bdf77622530e3080e508854409e Mon Sep 17 00:00:00 2001 From: Douglas Chiang Date: Thu, 26 Sep 2024 16:20:50 +0100 Subject: [PATCH 06/19] Add missing dependencies for tics. Signed-off-by: Douglas Chiang --- .github/workflows/checkbox-tics.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checkbox-tics.yml b/.github/workflows/checkbox-tics.yml index dedbbb50cc..2d6449ebfb 100644 --- a/.github/workflows/checkbox-tics.yml +++ b/.github/workflows/checkbox-tics.yml @@ -34,7 +34,7 @@ jobs: run: | sudo python -m pip install -e $PWD/checkbox-ng sudo python -m pip install -e $PWD/checkbox-support - sudo python -m pip install psutil==5.9.5 opencv_python==4.8.0.76 natsort==8.0.2 libsvm==3.23.0.4 numpy==1.26.4 coverage==7.3.0 urwid==2.1.2 pynmea2 pytest + sudo python -m pip install psutil==5.9.5 opencv_python==4.8.0.76 natsort==8.0.2 libsvm==3.23.0.4 numpy==1.26.4 coverage==7.3.0 urwid==2.1.2 pynmea2 loguru importlib_resources pylxd pytest - name: Run coverage tests run: | From 3fb9ea795c8bc74b21010c6b8753eeba9b6f65e7 Mon Sep 17 00:00:00 2001 From: Douglas Chiang Date: Fri, 27 Sep 2024 11:20:30 +0100 Subject: [PATCH 07/19] Add dependency for TiCS. Signed-off-by: Douglas Chiang --- .github/workflows/checkbox-tics.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/checkbox-tics.yml b/.github/workflows/checkbox-tics.yml index 2d6449ebfb..1e765e85a2 100644 --- a/.github/workflows/checkbox-tics.yml +++ b/.github/workflows/checkbox-tics.yml @@ -27,14 +27,14 @@ jobs: sudo apt-get update echo "::endgroup::" echo "::group::apt install..." - sudo apt-get install -y libsystemd-dev python3-pip pylint flake8 + sudo apt-get install -y libsystemd-dev python3-pip pylint flake8 libbluetooth3 libbluetooth-dev python-picamera python3-picamera echo "::endgroup::" - name: Install Checkbox run: | sudo python -m pip install -e $PWD/checkbox-ng sudo python -m pip install -e $PWD/checkbox-support - sudo python -m pip install psutil==5.9.5 opencv_python==4.8.0.76 natsort==8.0.2 libsvm==3.23.0.4 numpy==1.26.4 coverage==7.3.0 urwid==2.1.2 pynmea2 loguru importlib_resources pylxd pytest + sudo python -m pip install psutil==5.9.5 opencv_python==4.8.0.76 natsort==8.0.2 libsvm==3.23.0.4 numpy==1.26.4 coverage==7.3.0 urwid==2.1.2 pynmea2 loguru importlib_resources pylxd pytest evdev pyalsaaudio RPi.GPIO PyQRCode - name: Run coverage tests run: | From 67fa03c1cfc38026f205f166398dad731d96eab4 Mon Sep 17 00:00:00 2001 From: Douglas Chiang Date: Fri, 27 Sep 2024 11:23:42 +0100 Subject: [PATCH 08/19] Fix dependency installation Signed-off-by: Douglas Chiang --- .github/workflows/checkbox-tics.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/checkbox-tics.yml b/.github/workflows/checkbox-tics.yml index 1e765e85a2..f62447fba9 100644 --- a/.github/workflows/checkbox-tics.yml +++ b/.github/workflows/checkbox-tics.yml @@ -27,14 +27,14 @@ jobs: sudo apt-get update echo "::endgroup::" echo "::group::apt install..." - sudo apt-get install -y libsystemd-dev python3-pip pylint flake8 libbluetooth3 libbluetooth-dev python-picamera python3-picamera + sudo apt-get install -y libsystemd-dev python3-pip pylint flake8 libbluetooth3 libbluetooth-dev echo "::endgroup::" - name: Install Checkbox run: | sudo python -m pip install -e $PWD/checkbox-ng sudo python -m pip install -e $PWD/checkbox-support - sudo python -m pip install psutil==5.9.5 opencv_python==4.8.0.76 natsort==8.0.2 libsvm==3.23.0.4 numpy==1.26.4 coverage==7.3.0 urwid==2.1.2 pynmea2 loguru importlib_resources pylxd pytest evdev pyalsaaudio RPi.GPIO PyQRCode + sudo python -m pip install psutil==5.9.5 opencv_python==4.8.0.76 natsort==8.0.2 libsvm==3.23.0.4 numpy==1.26.4 coverage==7.3.0 urwid==2.1.2 pynmea2 loguru importlib_resources pylxd pytest evdev pyalsaaudio RPi.GPIO PyQRCode picamera - name: Run coverage tests run: | From fe9093039d47e65bef29856148fecf3887a805f9 Mon Sep 17 00:00:00 2001 From: Douglas Chiang Date: Fri, 27 Sep 2024 11:28:48 +0100 Subject: [PATCH 09/19] Add sound dependency. Signed-off-by: Douglas Chiang --- .github/workflows/checkbox-tics.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/checkbox-tics.yml b/.github/workflows/checkbox-tics.yml index f62447fba9..3c171cd02f 100644 --- a/.github/workflows/checkbox-tics.yml +++ b/.github/workflows/checkbox-tics.yml @@ -27,14 +27,14 @@ jobs: sudo apt-get update echo "::endgroup::" echo "::group::apt install..." - sudo apt-get install -y libsystemd-dev python3-pip pylint flake8 libbluetooth3 libbluetooth-dev + sudo apt-get install -y libsystemd-dev python3-pip pylint flake8 libbluetooth3 libbluetooth-dev libasound2-dev echo "::endgroup::" - name: Install Checkbox run: | sudo python -m pip install -e $PWD/checkbox-ng sudo python -m pip install -e $PWD/checkbox-support - sudo python -m pip install psutil==5.9.5 opencv_python==4.8.0.76 natsort==8.0.2 libsvm==3.23.0.4 numpy==1.26.4 coverage==7.3.0 urwid==2.1.2 pynmea2 loguru importlib_resources pylxd pytest evdev pyalsaaudio RPi.GPIO PyQRCode picamera + sudo python -m pip install psutil==5.9.5 opencv_python==4.8.0.76 natsort==8.0.2 libsvm==3.23.0.4 numpy==1.26.4 coverage==7.3.0 urwid==2.1.2 pynmea2 loguru importlib_resources pylxd pytest evdev pyalsaaudio RPi.GPIO PyQRCode - name: Run coverage tests run: | From eedee47ac26a62bc7dd412ed76295accc04a1ca7 Mon Sep 17 00:00:00 2001 From: Douglas Chiang Date: Fri, 27 Sep 2024 12:35:01 +0100 Subject: [PATCH 10/19] Add dependency. Signed-off-by: Douglas Chiang --- .github/workflows/checkbox-tics.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/checkbox-tics.yml b/.github/workflows/checkbox-tics.yml index 3c171cd02f..95b6236c17 100644 --- a/.github/workflows/checkbox-tics.yml +++ b/.github/workflows/checkbox-tics.yml @@ -27,14 +27,14 @@ jobs: sudo apt-get update echo "::endgroup::" echo "::group::apt install..." - sudo apt-get install -y libsystemd-dev python3-pip pylint flake8 libbluetooth3 libbluetooth-dev libasound2-dev + sudo apt-get install -y libsystemd-dev python3-pip pylint flake8 libbluetooth3 libbluetooth-dev libasound2-dev python3-zbar echo "::endgroup::" - name: Install Checkbox run: | sudo python -m pip install -e $PWD/checkbox-ng sudo python -m pip install -e $PWD/checkbox-support - sudo python -m pip install psutil==5.9.5 opencv_python==4.8.0.76 natsort==8.0.2 libsvm==3.23.0.4 numpy==1.26.4 coverage==7.3.0 urwid==2.1.2 pynmea2 loguru importlib_resources pylxd pytest evdev pyalsaaudio RPi.GPIO PyQRCode + sudo python -m pip install psutil==5.9.5 opencv_python==4.8.0.76 natsort==8.0.2 libsvm==3.23.0.4 numpy==1.26.4 coverage==7.3.0 urwid==2.1.2 pynmea2 loguru importlib_resources pylxd pytest evdev pyalsaaudio RPi.GPIO PyQRCode PyBluez picamera - name: Run coverage tests run: | From 56906ef5d212266ca411305478418a97260d393d Mon Sep 17 00:00:00 2001 From: Douglas Chiang Date: Fri, 27 Sep 2024 12:48:40 +0100 Subject: [PATCH 11/19] Add dependency. Signed-off-by: Douglas Chiang --- .github/workflows/checkbox-tics.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/checkbox-tics.yml b/.github/workflows/checkbox-tics.yml index 95b6236c17..c09ba095ab 100644 --- a/.github/workflows/checkbox-tics.yml +++ b/.github/workflows/checkbox-tics.yml @@ -34,7 +34,25 @@ jobs: run: | sudo python -m pip install -e $PWD/checkbox-ng sudo python -m pip install -e $PWD/checkbox-support - sudo python -m pip install psutil==5.9.5 opencv_python==4.8.0.76 natsort==8.0.2 libsvm==3.23.0.4 numpy==1.26.4 coverage==7.3.0 urwid==2.1.2 pynmea2 loguru importlib_resources pylxd pytest evdev pyalsaaudio RPi.GPIO PyQRCode PyBluez picamera + sudo python -m pip install \ + psutil==5.9.5 \ + opencv_python==4.8.0.76 \ + natsort==8.0.2 \ + libsvm==3.23.0.4 \ + numpy==1.26.4 \ + coverage==7.3.0 \ + urwid==2.1.2 \ + pynmea2 \ + loguru \ + importlib_resources \ + pylxd \ + pytest \ + evdev \ + pyalsaaudio \ + RPi.GPIO \ + PyQRCode \ + pybluez2 \ + git+https://github.com/waveform80/picamera - name: Run coverage tests run: | From 2099e68b3c41d526e2a4de4ca1df45bfd302c624 Mon Sep 17 00:00:00 2001 From: Douglas Chiang Date: Fri, 27 Sep 2024 15:17:38 +0100 Subject: [PATCH 12/19] Add PIL dependency... Signed-off-by: Douglas Chiang --- .github/workflows/checkbox-tics.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checkbox-tics.yml b/.github/workflows/checkbox-tics.yml index c09ba095ab..28abf9da45 100644 --- a/.github/workflows/checkbox-tics.yml +++ b/.github/workflows/checkbox-tics.yml @@ -27,7 +27,7 @@ jobs: sudo apt-get update echo "::endgroup::" echo "::group::apt install..." - sudo apt-get install -y libsystemd-dev python3-pip pylint flake8 libbluetooth3 libbluetooth-dev libasound2-dev python3-zbar + sudo apt-get install -y libsystemd-dev python3-pip pylint flake8 libbluetooth3 libbluetooth-dev libasound2-dev python3-zbar python3-pil echo "::endgroup::" - name: Install Checkbox From 2cde17bc9d7c27821ddcb22bf6fb1c5d6e28d4fb Mon Sep 17 00:00:00 2001 From: Douglas Chiang Date: Wed, 2 Oct 2024 12:33:38 +0100 Subject: [PATCH 13/19] cron job Signed-off-by: Douglas Chiang --- .github/workflows/checkbox-tics.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/checkbox-tics.yml b/.github/workflows/checkbox-tics.yml index 28abf9da45..34af5b5c09 100644 --- a/.github/workflows/checkbox-tics.yml +++ b/.github/workflows/checkbox-tics.yml @@ -1,12 +1,8 @@ name: TICS Code Quality Analysis on: - push: - branches: - - "main" - - "add-checkbox-tiobe" - # schedule: - # - cron: '00 19 * * *' + schedule: + - cron: '00 19 * * *' workflow_dispatch: permissions: @@ -18,8 +14,8 @@ jobs: environment: TICS steps: - uses: actions/checkout@v4 - # with: - # ref: main + with: + ref: main - name: Install dependencies run: | From 90d3a004be3189e33ccfe53982502d873b08bfea Mon Sep 17 00:00:00 2001 From: Douglas Chiang <39449881+douglasdotc@users.noreply.github.com> Date: Mon, 7 Oct 2024 14:06:02 +0100 Subject: [PATCH 14/19] Update .github/workflows/checkbox-tics.yml Co-authored-by: Massimiliano --- .github/workflows/checkbox-tics.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/checkbox-tics.yml b/.github/workflows/checkbox-tics.yml index 34af5b5c09..cfec60821a 100644 --- a/.github/workflows/checkbox-tics.yml +++ b/.github/workflows/checkbox-tics.yml @@ -14,8 +14,6 @@ jobs: environment: TICS steps: - uses: actions/checkout@v4 - with: - ref: main - name: Install dependencies run: | From 4798412d5890f10bc89082cb5764dda7fe0c52c3 Mon Sep 17 00:00:00 2001 From: Douglas Chiang <39449881+douglasdotc@users.noreply.github.com> Date: Mon, 7 Oct 2024 14:06:12 +0100 Subject: [PATCH 15/19] Update .github/workflows/checkbox-tics.yml Co-authored-by: Massimiliano --- .github/workflows/checkbox-tics.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/checkbox-tics.yml b/.github/workflows/checkbox-tics.yml index cfec60821a..0e059120aa 100644 --- a/.github/workflows/checkbox-tics.yml +++ b/.github/workflows/checkbox-tics.yml @@ -17,12 +17,8 @@ jobs: - name: Install dependencies run: | - echo "::group::apt update" sudo apt-get update - echo "::endgroup::" - echo "::group::apt install..." sudo apt-get install -y libsystemd-dev python3-pip pylint flake8 libbluetooth3 libbluetooth-dev libasound2-dev python3-zbar python3-pil - echo "::endgroup::" - name: Install Checkbox run: | From 9e99cc33d79aa965f61bbd46f8c032c12e72387a Mon Sep 17 00:00:00 2001 From: Douglas Chiang <39449881+douglasdotc@users.noreply.github.com> Date: Mon, 7 Oct 2024 14:07:30 +0100 Subject: [PATCH 16/19] Update .github/workflows/checkbox-tics.yml Co-authored-by: Massimiliano --- .github/workflows/checkbox-tics.yml | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/.github/workflows/checkbox-tics.yml b/.github/workflows/checkbox-tics.yml index 0e059120aa..442bfe3af5 100644 --- a/.github/workflows/checkbox-tics.yml +++ b/.github/workflows/checkbox-tics.yml @@ -51,29 +51,11 @@ jobs: # Providers echo "::group::coverage tests for providers..." - cd $REPO_DIR/providers/base - coverage run --append --branch --data-file=$COVR_DIR/.coverage manage.py test -u - cd $REPO_DIR/providers/certification-client - coverage run --append --branch --data-file=$COVR_DIR/.coverage manage.py test -u - cd $REPO_DIR/providers/certification-server - coverage run --append --branch --data-file=$COVR_DIR/.coverage manage.py test -u - cd $REPO_DIR/providers/docker - coverage run --append --branch --data-file=$COVR_DIR/.coverage manage.py test -u - cd $REPO_DIR/providers/genio - coverage run --append --branch --data-file=$COVR_DIR/.coverage manage.py test -u - cd $REPO_DIR/providers/gpgpu - coverage run --append --branch --data-file=$COVR_DIR/.coverage manage.py test -u - cd $REPO_DIR/providers/iiotg - coverage run --append --branch --data-file=$COVR_DIR/.coverage manage.py test -u - cd $REPO_DIR/providers/resource - coverage run --append --branch --data-file=$COVR_DIR/.coverage manage.py test -u - cd $REPO_DIR/providers/sru - coverage run --append --branch --data-file=$COVR_DIR/.coverage manage.py test -u - cd $REPO_DIR/providers/tpm2 - coverage run --append --branch --data-file=$COVR_DIR/.coverage manage.py test -u - cd $REPO_DIR/providers/tutorial - coverage run --append --branch --data-file=$COVR_DIR/.coverage manage.py test -u - cd $REPO_DIR + providers="base certification-client certification-server docker genio gpgpu iiotg resource sru tpm2" + for provider in $providers; do + cd "$REPO_DIR/providers/$provider" + coverage run --append --branch --data-file="$COVR_DIR/.coverage" manage.py test -u + done echo "::endgroup::" # Checkbox-ng From a8b9070e9b03d52fe21bd06173f7219d38b492fa Mon Sep 17 00:00:00 2001 From: Douglas Chiang Date: Mon, 7 Oct 2024 14:44:42 +0100 Subject: [PATCH 17/19] try tox pip install list Signed-off-by: Douglas Chiang --- .github/workflows/checkbox-tics.yml | 35 ++++++++++++++++------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/.github/workflows/checkbox-tics.yml b/.github/workflows/checkbox-tics.yml index 442bfe3af5..0d058d742e 100644 --- a/.github/workflows/checkbox-tics.yml +++ b/.github/workflows/checkbox-tics.yml @@ -1,8 +1,10 @@ name: TICS Code Quality Analysis on: - schedule: - - cron: '00 19 * * *' + push: + branches: [ add-checkbox-tiobe ] + # schedule: + # - cron: '00 19 * * *' workflow_dispatch: permissions: @@ -25,24 +27,25 @@ jobs: sudo python -m pip install -e $PWD/checkbox-ng sudo python -m pip install -e $PWD/checkbox-support sudo python -m pip install \ + pyparsing==2.4.7 \ + requests==2.25.1 \ + XlsxWriter==3.0.2 \ + Jinja2==3.0.3 \ psutil==5.9.5 \ - opencv_python==4.8.0.76 \ - natsort==8.0.2 \ libsvm==3.23.0.4 \ - numpy==1.26.4 \ - coverage==7.3.0 \ urwid==2.1.2 \ - pynmea2 \ - loguru \ - importlib_resources \ - pylxd \ + systemd-python==235 \ + distro==1.7.0 \ + coverage==7.3.0 \ + flake8 \ + MarkupSafe==2.0.1 \ pytest \ - evdev \ - pyalsaaudio \ - RPi.GPIO \ - PyQRCode \ - pybluez2 \ - git+https://github.com/waveform80/picamera + opencv_python==4.8.1.78 \ + natsort==8.0.2 \ + tqdm==4.57.0 \ + PyYAML==6.0.1 \ + numpy==1.26.4 \ + pytest-cov==4.1.0 - name: Run coverage tests run: | From a3103e96393e6d6488473443a25b69da2fa7144d Mon Sep 17 00:00:00 2001 From: Douglas Chiang Date: Mon, 7 Oct 2024 14:48:11 +0100 Subject: [PATCH 18/19] Fix path Signed-off-by: Douglas Chiang --- .github/workflows/checkbox-tics.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/checkbox-tics.yml b/.github/workflows/checkbox-tics.yml index 0d058d742e..f75f8baed4 100644 --- a/.github/workflows/checkbox-tics.yml +++ b/.github/workflows/checkbox-tics.yml @@ -63,12 +63,12 @@ jobs: # Checkbox-ng echo "::group::coverage tests for checkbox-ng..." - coverage run --append --branch --data-file=$COVR_DIR/.coverage -m pytest $PWD/checkbox-ng + coverage run --append --branch --data-file=$COVR_DIR/.coverage -m pytest $REPO_DIR/checkbox-ng echo "::endgroup::" # Checkbox-support echo "::group::coverage tests for checkbox-support..." - coverage run --append --branch --data-file=$COVR_DIR/.coverage -m pytest $PWD/checkbox-support/checkbox_support/ + coverage run --append --branch --data-file=$COVR_DIR/.coverage -m pytest $REPO_DIR/checkbox-support/checkbox_support/ echo "::endgroup::" # Coverage report XML From 40adf18b5e1d8371a547f64055d92d187dbe7798 Mon Sep 17 00:00:00 2001 From: Douglas Chiang Date: Mon, 7 Oct 2024 17:08:15 +0100 Subject: [PATCH 19/19] Turn back to cron job Signed-off-by: Douglas Chiang --- .github/workflows/checkbox-tics.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/checkbox-tics.yml b/.github/workflows/checkbox-tics.yml index f75f8baed4..e41b6c7741 100644 --- a/.github/workflows/checkbox-tics.yml +++ b/.github/workflows/checkbox-tics.yml @@ -1,10 +1,8 @@ name: TICS Code Quality Analysis on: - push: - branches: [ add-checkbox-tiobe ] - # schedule: - # - cron: '00 19 * * *' + schedule: + - cron: '00 19 * * *' workflow_dispatch: permissions: