From 557b66ec06abc26fd6fb81f117bc1dd5df005803 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 7 Jan 2022 11:24:53 +0100 Subject: [PATCH] GitHub CI coverity_scan: check for tool update Coverity doesn't provide ETag but a filename with content-disposition header, eg.: content-disposition: attachment; filename="cov-analysis-linux64-2020.09.tar.gz" --- .github/workflows/coverity-scan.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/coverity-scan.yml b/.github/workflows/coverity-scan.yml index 371325ea5..87ce4a342 100644 --- a/.github/workflows/coverity-scan.yml +++ b/.github/workflows/coverity-scan.yml @@ -13,20 +13,25 @@ jobs: coverity_token: ${{ secrets.coverity_token }} steps: + - name: Get Coverity tool name # the file name contains version and is used as the cache key + id: tool + run: | + FILENAME=$(curl -LI "https://scan.coverity.com/download/linux64?token=$coverity_token&project=UltraGrid" | sed -n '/content-disposition/s/.*\"\(.*\)\"/\1/p') + echo "::set-output name=filename::$FILENAME" - name: Cache Coverity build tool id: cache-coverity-tool uses: actions/cache@v2 with: - path: '/tmp/cov-analysis' - key: cache-coverity-tool + path: coverity_tool.tgz + key: cache-coverity-tool-${{ steps.tool.outputs.filename }} - name: Download Coverity build tool if: steps.cache-coverity-tool.outputs.cache-hit != 'true' run: | - cd /tmp - rm -rf cov-analysis wget --no-verbose https://scan.coverity.com/download/linux64 --post-data "token=$coverity_token&project=UltraGrid" -O coverity_tool.tgz + - name: Extract Coverity build tool + run: | tar xaf coverity_tool.tgz - mv /tmp/cov-analysis* /tmp/cov-analysis + mv cov-analysis* /tmp/cov-analysis - uses: actions/checkout@v1 with: submodules: true