From 4db168474c7c0dee642ef5a90dcdbd2e3a2cf39a Mon Sep 17 00:00:00 2001 From: Carlos Wu Date: Wed, 12 Jun 2024 13:36:52 +0100 Subject: [PATCH] Add TICS coverage (#145) --- .github/workflows/tics-coverage.yaml | 43 ++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/tics-coverage.yaml diff --git a/.github/workflows/tics-coverage.yaml b/.github/workflows/tics-coverage.yaml new file mode 100644 index 0000000..7fef7a0 --- /dev/null +++ b/.github/workflows/tics-coverage.yaml @@ -0,0 +1,43 @@ +name: Upload TICS report +on: + push: + branches: + - main + +jobs: + TICS: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [18.x] + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: "yarn" + - name: Install + run: yarn install --immutable + - run: yarn test --coverage.enabled true + - name: Upload coverage report + if: always() + uses: actions/upload-artifact@v4 + with: + name: ubuntu-security-api-coverage + path: coverage + - name: Produce TICS report + shell: bash + run: | + set -x + export TICSAUTHTOKEN=${{ secrets.TICS_AUTH_TOKEN }} + 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/" > install_tics.sh + . ./install_tics.sh + TICSQServer -project ubuntu-com-security-api -tmpdir /tmp/tics -branchdir . + - name: Upload TICS report + if: always() + uses: actions/upload-artifact@v4 + with: + name: tics-report + path: /tmp/tics/ticstmpdir + retention-days: 7