From 142549477da6a303fc51e0a321576f04cb5a888c Mon Sep 17 00:00:00 2001 From: makslevental Date: Thu, 29 Aug 2024 17:04:46 -0500 Subject: [PATCH] remove cache storage for PRs --- .github/workflows/ci-linux.yml | 28 ++++------------------------ .github/workflows/ci-macos.yml | 20 +++----------------- .github/workflows/ci-windows.yml | 19 +++---------------- build_tools/ci/build_test_cpp.sh | 4 ---- 4 files changed, 10 insertions(+), 61 deletions(-) diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 8051cc333..d0529f584 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -21,12 +21,6 @@ concurrency: group: ci-build-test-cpp-linux-${{ github.event.number || github.sha }} cancel-in-progress: true -permissions: - contents: read - # required to delete cache - # https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-github-actions-caches-for-a-repository-using-a-cache-key - actions: write - jobs: build_and_ctest: name: Build and Test (linux, ASSERTIONS) @@ -58,12 +52,7 @@ jobs: - name: Install deps run: | yum remove -y openssl-devel zlib-devel || true - - dnf install -y almalinux-release-devel - type -p yum-config-manager >/dev/null || yum -y install yum-utils - yum-config-manager -y --add-repo https://cli.github.com/packages/rpm/gh-cli.repo - - yum install -y protobuf-devel protobuf-compiler gh + yum install -y protobuf-devel protobuf-compiler - name: Sync source deps run: | @@ -85,7 +74,7 @@ jobs: # https://interrupt.memfault.com/blog/ccache-debugging echo CCACHE_DEBUG=1 >> $GITHUB_ENV echo CCACHE_DEBUGLEVEL=2 >> $GITHUB_ENV - echo CCACHE_DEBUGDIR="/ccache-debug" >> $GITHUB_ENV + echo CCACHE_DEBUGDIR="$HOME/ccache-debug" >> $GITHUB_ENV echo CCACHE_SLOPPINESS=include_file_ctime,include_file_mtime,time_macros >> $GITHUB_ENV echo CCACHE_COMPILERCHECK=content >> $GITHUB_ENV @@ -102,6 +91,7 @@ jobs: - name: Tar ccache logs if: ${{ !cancelled() }} run: | + ccache --show-stats -v tar cf linux-ccache-logs.tar $CCACHE_DEBUGDIR - name: Upload ccache logs @@ -120,19 +110,9 @@ jobs: path: iree-dist-linux.tar if-no-files-found: warn - - name: Overwrite cache - if: ${{ !cancelled() }} - continue-on-error: true - env: - # required to run gh with privileges - GH_TOKEN: ${{ github.token }} - run: | - gh extension install actions/gh-actions-cache - gh actions-cache delete ${{ env.CACHE_KEY }} --confirm -R ${{ github.repository }} - - name: Save cache uses: actions/cache/save@v3 - if: ${{ !cancelled() }} + if: ${{ !cancelled() && github.event_name != 'pull_request' }} with: path: ${{ env.CACHE_DIR }} key: ${{ env.CACHE_KEY }} diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml index 6d85321a0..069831e34 100644 --- a/.github/workflows/ci-macos.yml +++ b/.github/workflows/ci-macos.yml @@ -16,10 +16,6 @@ concurrency: group: ci-build-test-cpp-macos-${{ github.event.number || github.sha }} cancel-in-progress: true -permissions: - contents: read - actions: write - jobs: build_and_ctest: name: Build and Test (${{ matrix.runs-on }}, ASSERTIONS) @@ -70,12 +66,10 @@ jobs: - name: Configure ccache debug logs run: | - # https://interrupt.memfault.com/blog/ccache-debugging echo CCACHE_DEBUG=1 >> $GITHUB_ENV echo CCACHE_DEBUGLEVEL=2 >> $GITHUB_ENV - echo CCACHE_DEBUGDIR="/ccache-debug" >> $GITHUB_ENV + echo CCACHE_DEBUGDIR="$HOME/ccache-debug" >> $GITHUB_ENV echo CCACHE_SLOPPINESS=include_file_ctime,include_file_mtime,time_macros >> $GITHUB_ENV - echo CCACHE_COMPILERCHECK=content >> $GITHUB_ENV - name: Build packages run: | @@ -90,6 +84,7 @@ jobs: - name: Tar ccache logs if: ${{ !cancelled() }} run: | + ccache --show-stats -v tar cf macos-ccache-logs.tar $CCACHE_DEBUGDIR - name: Upload ccache logs @@ -108,18 +103,9 @@ jobs: path: iree-dist-${{ matrix.runs-on }}.tar if-no-files-found: warn - - name: Overwrite cache - if: ${{ !cancelled() }} - continue-on-error: true - env: - GH_TOKEN: ${{ github.token }} - run: | - gh extension install actions/gh-actions-cache - gh actions-cache delete ${{ env.CACHE_KEY }} --confirm -R ${{ github.repository }} - - name: Save cache uses: actions/cache/save@v3 - if: ${{ !cancelled() }} + if: ${{ !cancelled() && github.event_name != 'pull_request' }} with: path: ${{ env.CACHE_DIR }} key: ${{ env.CACHE_KEY }} diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index 61b5306f6..d7cb8a929 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -21,10 +21,6 @@ defaults: # force bash for windows shell: bash -permissions: - contents: read - actions: write - jobs: build_and_ctest: name: Build and Test (windows, ASSERTIONS) @@ -78,10 +74,9 @@ jobs: - name: Configure ccache debug logs run: | - # https://interrupt.memfault.com/blog/ccache-debugging echo CCACHE_DEBUG=1 >> $GITHUB_ENV echo CCACHE_DEBUGLEVEL=2 >> $GITHUB_ENV - echo CCACHE_DEBUGDIR="/ccache-debug" >> $GITHUB_ENV + echo CCACHE_DEBUGDIR="/c/ccache-debug" >> $GITHUB_ENV echo CCACHE_SLOPPINESS=include_file_ctime,include_file_mtime,time_macros >> $GITHUB_ENV echo CCACHE_COMPILERCHECK=content >> $GITHUB_ENV @@ -98,6 +93,7 @@ jobs: - name: Tar ccache logs if: ${{ !cancelled() }} run: | + ccache --show-stats -v tar cf windows-ccache-logs.tar $CCACHE_DEBUGDIR - name: Upload ccache logs @@ -116,18 +112,9 @@ jobs: path: iree-dist-windows.tar if-no-files-found: warn - - name: Overwrite cache - if: ${{ !cancelled() }} - continue-on-error: true - env: - GH_TOKEN: ${{ github.token }} - run: | - gh extension install actions/gh-actions-cache - gh actions-cache delete ${{ env.CACHE_KEY }} --confirm -R ${{ github.repository }} - - name: Save cache uses: actions/cache/save@v3 - if: ${{ !cancelled() }} + if: ${{ !cancelled() && github.event_name != 'pull_request' }} with: path: ${{ env.CACHE_DIR }} key: ${{ env.CACHE_KEY }} diff --git a/build_tools/ci/build_test_cpp.sh b/build_tools/ci/build_test_cpp.sh index 94a2d0b28..296dfc353 100644 --- a/build_tools/ci/build_test_cpp.sh +++ b/build_tools/ci/build_test_cpp.sh @@ -115,10 +115,6 @@ elif [[ "$OSTYPE" == "msys"* ]]; then ctest --test-dir "$build_dir" -R amd-aie --output-on-failure -j --repeat until-pass:5 fi -# Show ccache stats. -ccache --show-stats -v -grep -r -B15 'Result: .*_miss' $CCACHE_DEBUGDIR - rm -f "$install_dir"/bin/clang* rm -f "$install_dir"/bin/llvm-link* cp "$build_dir"/tools/testing/e2e/iree-e2e-matmul-test "$install_dir"/bin