From 7d535bdcb54a1e0d1ff8e75c51fbf704ad2329e4 Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Thu, 16 Jan 2025 13:32:41 +0000 Subject: [PATCH] tics: Fixes TICS nightly job We don't have any unit tests for this project, but TICS expects the cover folder to exist. TICS will try to use pylint and flake8 to analyze the project's code. We need to install them beforehand. Signed-off-by: Claudiu Belu --- .github/workflows/cron-jobs.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/cron-jobs.yaml b/.github/workflows/cron-jobs.yaml index 07ecc75..bb0d1ff 100644 --- a/.github/workflows/cron-jobs.yaml +++ b/.github/workflows/cron-jobs.yaml @@ -3,6 +3,7 @@ name: Security and quality nightly scan on: schedule: - cron: '0 10 * * *' + pull_request: permissions: contents: read @@ -22,6 +23,27 @@ jobs: - name: Checking out repo uses: actions/checkout@v4 + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install Python dependencies + run: | + # pylint and flake8 are required by TICSQServer. + pip install pylint flake8 + + # pylint requires the packages to be installed. + # On ubuntu-24.04, we have gcc 13, and abseil (grpc's dependency) fails to build with + # this version of gcc. Thus, we're building with gcc 12. + # xref: https://github.com/apache/arrow/issues/36969 + sudo apt install build-essential libbtrfsutil-dev gcc-12 g++-12 + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12 --slave /usr/bin/g++ g++ /usr/bin/g++-12 + + pip wheel -w wheels/ "https://github.com/kdave/btrfs-progs/archive/refs/tags/v6.3.2.tar.gz#egg=btrfsutil&subdirectory=libbtrfsutil/python" + pip install wheels/* + pip install -r requirements.txt + - name: Install Go uses: actions/setup-go@v5 with: @@ -33,6 +55,9 @@ jobs: set -x + # We don't have any unit tests for this project, but TICS expects this folder to exist. + mkdir -p cover + # Install the TICS and staticcheck go install honnef.co/go/tools/cmd/staticcheck@v0.5.1 . <(curl --silent --show-error 'https://canonical.tiobe.com/tiobeweb/TICS/api/public/v1/fapi/installtics/Script?cfg=default&platform=linux&url=https://canonical.tiobe.com/tiobeweb/TICS/')