From 2cf51642f891c9ac55ff4355ba4a56f9a4e82fd5 Mon Sep 17 00:00:00 2001 From: Philipp Pracht Date: Fri, 2 Feb 2024 18:44:27 +0100 Subject: [PATCH] gh actions cache improvements (#3634) --- .github/workflows/cleanup.yml | 35 ------------------- .github/workflows/compatibility.yml | 4 +-- .github/workflows/container-release.yml | 4 +-- .../luigi-client-support-ui5-release.yml | 4 +-- .github/workflows/mend.yml | 2 +- .github/workflows/nightly-release.yml | 4 +-- .github/workflows/rc-release.yml | 4 +-- .github/workflows/test.yml | 20 ++++------- 8 files changed, 17 insertions(+), 60 deletions(-) delete mode 100644 .github/workflows/cleanup.yml diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml deleted file mode 100644 index 6c727f9f61..0000000000 --- a/.github/workflows/cleanup.yml +++ /dev/null @@ -1,35 +0,0 @@ -on: - workflow_call: - inputs: - buildcache_key: - type: string - required: true - -name: Cleanup - -jobs: - clear_cache: - name: Clear Caches - runs-on: ubuntu-latest - continue-on-error: true - steps: - - run: | - gh extension install actions/gh-actions-cache - - REPO=${{ github.repository }} - BRANCH=${{ github.ref }} - - ## echo "Fetching list of cache key" - ## cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 ) - cacheKeysForPR=(${{ inputs.buildcache_key }}) - - ## Setting this to not fail the workflow while deleting cache keys. - set +e - echo "Deleting caches..." - for cacheKey in $cacheKeysForPR - do - gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm - done - echo "Done" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/compatibility.yml b/.github/workflows/compatibility.yml index e407afc183..9f4770ccaa 100644 --- a/.github/workflows/compatibility.yml +++ b/.github/workflows/compatibility.yml @@ -11,7 +11,7 @@ jobs: prepare: uses: ./.github/workflows/prepare.yml with: - buildcache_key: compat_buildcache + buildcache_key: compat_buildcache-${{ github.ref }} secrets: inherit compatibility: @@ -28,6 +28,6 @@ jobs: path: | ~/tmp_build ~/cypress-binary-cache - key: compat_buildcache + key: compat_buildcache-${{ github.ref }} - run: cp -r ~/tmp_build/* . - run: bash ./scripts/testCompatibility.sh --tag latest \ No newline at end of file diff --git a/.github/workflows/container-release.yml b/.github/workflows/container-release.yml index 860b292613..beb2678d46 100644 --- a/.github/workflows/container-release.yml +++ b/.github/workflows/container-release.yml @@ -8,7 +8,7 @@ jobs: uses: ./.github/workflows/prepare.yml secrets: inherit with: - buildcache_key: buildcache-container + buildcache_key: buildcache-container-${{ github.ref }} publish: runs-on: ubuntu-latest @@ -24,7 +24,7 @@ jobs: path: | ~/tmp_build ~/cypress-binary-cache - key: buildcache-container + key: buildcache-container-${{ github.ref }} - run: cp -r ~/tmp_build/* . - run: echo "//registry.npmjs.org/:_authToken=$NPM_LUI_AUTH_TOKEN" > ~/.npmrc - run: ls ./container/public diff --git a/.github/workflows/luigi-client-support-ui5-release.yml b/.github/workflows/luigi-client-support-ui5-release.yml index fea06b141c..b5b72af959 100644 --- a/.github/workflows/luigi-client-support-ui5-release.yml +++ b/.github/workflows/luigi-client-support-ui5-release.yml @@ -8,7 +8,7 @@ jobs: uses: ./.github/workflows/prepare.yml secrets: inherit with: - buildcache_key: buildcache-luigi-client-support-ui5-release + buildcache_key: buildcache-luigi-client-support-ui5-release-${{ github.ref }} publish: runs-on: ubuntu-latest @@ -24,7 +24,7 @@ jobs: path: | ~/tmp_build ~/cypress-binary-cache - key: buildcache-luigi-client-support-ui5-release + key: buildcache-luigi-client-support-ui5-release-${{ github.ref }} - run: cp -r ~/tmp_build/* . - run: echo "//registry.npmjs.org/:_authToken=$NPM_LUI_AUTH_TOKEN" > ~/.npmrc - run: ls ./client-frameworks-support/client-support-ui5/dist diff --git a/.github/workflows/mend.yml b/.github/workflows/mend.yml index 8b4d40ac99..3d3dfabe2a 100644 --- a/.github/workflows/mend.yml +++ b/.github/workflows/mend.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/cache@v4 with: path: ~/.cache - key: whitesource_cache + key: whitesource_cache-${{ github.ref }} - run: sudo apt-get install build-essential python2 libgconf-2-4 libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb - run: npm --prefix ./client ci ./client - run: npm --prefix ./core ci ./core diff --git a/.github/workflows/nightly-release.yml b/.github/workflows/nightly-release.yml index dc576c70a3..be96d6ec61 100644 --- a/.github/workflows/nightly-release.yml +++ b/.github/workflows/nightly-release.yml @@ -17,7 +17,7 @@ jobs: uses: ./.github/workflows/prepare.yml secrets: inherit with: - buildcache_key: buildcache-nightly + buildcache_key: buildcache-nightly-${{ github.ref }} publish: runs-on: ubuntu-latest @@ -33,7 +33,7 @@ jobs: path: | ~/tmp_build ~/cypress-binary-cache - key: buildcache-nightly + key: buildcache-nightly-${{ github.ref }} - run: cp -r ~/tmp_build/* . - run: echo "//registry.npmjs.org/:_authToken=$NPM_LUI_AUTH_TOKEN" > ~/.npmrc - run: cd ./scripts && npm ci diff --git a/.github/workflows/rc-release.yml b/.github/workflows/rc-release.yml index 84fa10140f..f047222912 100644 --- a/.github/workflows/rc-release.yml +++ b/.github/workflows/rc-release.yml @@ -16,7 +16,7 @@ jobs: uses: ./.github/workflows/prepare.yml secrets: inherit with: - buildcache_key: buildcache-rc + buildcache_key: buildcache-rc-${{ github.ref }} publish: runs-on: ubuntu-latest @@ -32,7 +32,7 @@ jobs: path: | ~/tmp_build ~/cypress-binary-cache - key: buildcache-rc + key: buildcache-rc-${{ github.ref }} - run: cp -r ~/tmp_build/* . - run: echo "//registry.npmjs.org/:_authToken=$NPM_LUI_AUTH_TOKEN" > ~/.npmrc - run: cd ./scripts && npm ci diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 35dbe3fe77..510f82939c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: uses: ./.github/workflows/prepare.yml secrets: inherit with: - buildcache_key: buildcache + buildcache_key: buildcache-${{ github.ref }} unit: name: Unit Tests @@ -29,7 +29,7 @@ jobs: path: | ~/tmp_build ~/cypress-binary-cache - key: buildcache + key: buildcache-${{ github.ref }} - run: cp -r ~/tmp_build/* . - run: npm test --prefix core || exit 1 @@ -47,7 +47,7 @@ jobs: path: | ~/tmp_build ~/cypress-binary-cache - key: buildcache + key: buildcache-${{ github.ref }} - run: cp -r ~/tmp_build/* . - run: npm i -g cypress - run: npm i -g live-server @@ -67,7 +67,7 @@ jobs: path: | ~/tmp_build ~/cypress-binary-cache - key: buildcache + key: buildcache-${{ github.ref }} - run: cp -r ~/tmp_build/* . - run: npm test --prefix container || exit 1 @@ -86,7 +86,7 @@ jobs: path: | ~/tmp_build ~/cypress-binary-cache - key: buildcache + key: buildcache-${{ github.ref }} - run: cp -r ~/tmp_build/* . - run: bash ./container/run-container-e2e.sh || exit 1 @@ -104,7 +104,7 @@ jobs: path: | ~/tmp_build ~/cypress-binary-cache - key: buildcache + key: buildcache-${{ github.ref }} - run: cp -r ~/tmp_build/* . - run: sudo apt-get install libgconf-2-4 libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb - run: npm install --prefix test/e2e-test-application @babel/plugin-proposal-class-properties @@ -112,14 +112,6 @@ jobs: - run: bash ./test/e2e-js.sh || exit 1 - run: bash ./test/e2e-angular.sh || exit 1 - cleanup: - needs: [e2e, container_unit_tests, container_e2e_tests, mock_engine, unit] - uses: ./.github/workflows/cleanup.yml - secrets: inherit - with: - buildcache_key: buildcache - - docu_check: name: Check Documentation runs-on: ubuntu-latest