diff --git a/.github/workflows/cached_tics.yml b/.github/workflows/cached_tics.yml new file mode 100644 index 0000000..7603763 --- /dev/null +++ b/.github/workflows/cached_tics.yml @@ -0,0 +1,46 @@ +name: TICS run (script) + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout the project + uses: actions/checkout@v4 + + - name: Install dependencies + run: sudo apt-get update + + - uses: actions/cache@v4 + id: cache-tics + with: + path: | + /home/runner/ + /var/tmp/runner/tics/ + key: ${{ runner.os }}-tics + + - name: Download and install TICS artifactory + if: steps.cache-tics.outputs.cache-hit != 'false' + run: | + set -x + export TICSAUTHTOKEN="${{ secrets.TICSAUTHTOKEN }}" + + # Download TICS + 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 + . ./install_tics.sh + + - name: Execute TICS analysis + if: steps.cache-tics.outputs.cache-hit != 'true' + run: | + set -x + export TICSAUTHTOKEN="${{ secrets.TICSAUTHTOKEN }}" + source /home/runner/.profile + TICSQServer -project testimage -tmpdir /tmp/tics -branchdir .