From 571c33f25083c21408ced85740a611b6c067ce4f Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Mon, 20 Jan 2025 09:00:43 +0000 Subject: [PATCH] actions: TICS job cleanup --- .github/workflows/tiobe-tics-cron.yaml | 49 ++++++++++++++++++-------- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/.github/workflows/tiobe-tics-cron.yaml b/.github/workflows/tiobe-tics-cron.yaml index 2edd2cbc..a788d554 100644 --- a/.github/workflows/tiobe-tics-cron.yaml +++ b/.github/workflows/tiobe-tics-cron.yaml @@ -1,15 +1,18 @@ -name: Tiobe TiCS nightly report +name: Tiobe TICS nightly report on: - workflow_dispatch: schedule: - cron: '0 10 * * *' + pull_request: + paths: + - .github/workflows/tiobe-tics-cron.yaml + permissions: contents: read jobs: - TiCS: + TICS: permissions: contents: read runs-on: ubuntu-latest @@ -27,8 +30,16 @@ jobs: - name: Checking out repo uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 with: - ref: ${{matrix.branch}} + python-version: '3.12' + + - name: Install Python dependencies + run: | + # pylint and flake8 are required by TICSQServer. + pip install pylint flake8 + pip install -r test/performance/requirements-test.txt - name: Install Go uses: actions/setup-go@v5 @@ -43,14 +54,11 @@ jobs: set -eux -o pipefail # TiCS requires us to have the test results in cobertura xml format under the - # directory use below + # directory used below sudo make go.coverage go install github.com/boumenot/gocover-cobertura@latest - gocover-cobertura < coverage.txt > coverage.xml - mkdir .coverage - mv ./coverage.xml ./.coverage/ - - cat ./.coverage/coverage.xml + mkdir -p .coverage + gocover-cobertura < coverage.txt > .coverage/coverage.xml - name: Build Project run: | @@ -59,7 +67,7 @@ jobs: # We load the dqlite libs here instead of doing through make because TICS # will try to build parts of the project itself sudo add-apt-repository -y ppa:dqlite/dev - sudo apt install dqlite-tools libdqlite-dev -y + sudo apt install libdqlite1.17-dev # We need to have our project built sudo make clean @@ -67,13 +75,26 @@ jobs: - name: Install and Run TiCS run: | + export TICSAUTHTOKEN=${{ secrets.TICSAUTHTOKEN }} + # NOTE(aznashwan): TiCS install script doesn't define defaults; cannot '-u' set -ex -o pipefail - export TICSAUTHTOKEN=${{ secrets.TICSAUTHTOKEN }} - # 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/') - TICSQServer -project k8s-dqlite -tmpdir /tmp/tics -branchdir $HOME/work/k8s-dqlite/k8s-dqlite/ + # Performance tests are importing a local test_util module. Needed for pylint. + export PYTHONPATH="$(pwd)/test/performance/tests/" + + # TICSQServer will try to build the project. We need a few environment variables + # for it to succeed. Based on make static / "hack/static-dqlite.sh". + export INSTALL_DIR="$(pwd)/hack/.deps/static" + export PATH="${PATH}:${INSTALL_DIR}/musl/bin" + export CC=musl-gcc + export CGO_CFLAGS="-I${INSTALL_DIR}/include" + export CGO_LDFLAGS="-L${INSTALL_DIR}/lib -luv -ldqlite -llz4 -lsqlite3 -Wl,-z,stack-size=1048576" + + TICSQServer -project ${{ github.event.repository.name }} -tmpdir /tmp/tics -branchdir "$GITHUB_WORKSPACE" + + cat /tmp/tics/ticstmpdir/Coverity/cov-build-console.log