From 0530b44139798c6d261627b69ce91345722b5024 Mon Sep 17 00:00:00 2001 From: yuyawk Date: Sun, 7 Apr 2024 20:14:51 +0900 Subject: [PATCH] revert: do not cache it at all, as it has not improved --- .github/workflows/unit-tests.yml | 48 ++++---------------------------- .gitignore | 3 -- 2 files changed, 6 insertions(+), 45 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 1ec422b..4ddd675 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -10,12 +10,6 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -env: - # Location to store the bazelisk executable - BAZELISK_BIN_DIR: .bazelisk-bin - # Version of the bazelisk to use - BAZELISK_VERSION: v1.19.0/bazelisk-linux-amd64 - jobs: unit-tests: runs-on: ubuntu-22.04 @@ -24,42 +18,12 @@ jobs: uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} - - name: Get build cache key - id: build-cache-key - run: | - echo "key=${{ runner.os }}-build-${{ hashFiles('**') }}" \ - >> "${GITHUB_OUTPUT}" - - name: Try to restore build cache - uses: actions/cache/restore@v4 - with: - path: .cache - key: ${{ steps.build-cache-key.outputs.key }} - restore-keys: ${{ runner.os }}-build- - - name: Try to restore bazelisk binary - id: cache-bazelisk-bin - uses: actions/cache/restore@v4 - with: - path: ${{ env.BAZELISK_BIN_DIR }} - key: ${{ env.BAZELISK_VERSION }}-bazelisk-bin - - name: Install bazelisk if it's needed - if: steps.cache-bazelisk-bin.outputs.cache-hit != 'true' + - name: Install bazelisk run: | - mkdir -p ${{ env.BAZELISK_BIN_DIR }} - wget https://github.com/bazelbuild/bazelisk/releases/download/${{ env.BAZELISK_VERSION }} \ - -O "${{ env.BAZELISK_BIN_DIR }}/bazelisk" - chmod +x "${{ env.BAZELISK_BIN_DIR }}/bazelisk" - - name: Save bazelisk binary - uses: actions/cache/save@v4 - if: steps.cache-bazelisk-bin.outputs.cache-hit != 'true' - with: - path: ${{ env.BAZELISK_BIN_DIR }} - key: ${{ env.BAZELISK_VERSION }}-bazelisk-bin - - name: Add bazelisk to PATH - run: echo "${{ env.BAZELISK_BIN_DIR }}" >> "${GITHUB_PATH}" + bazelisk_dir="$(realpath "$(mktemp -d -p .)")" + wget https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64 \ + -O "${bazelisk_dir}/bazelisk" + chmod +x "${bazelisk_dir}/bazelisk" + echo "${bazelisk_dir}" >> "${GITHUB_PATH}" - name: Run unit tests run: ./execute_tests.bash - - name: Save build cache - uses: actions/cache/save@v4 - with: - path: .cache - key: ${{ steps.build-cache-key.outputs.key }} diff --git a/.gitignore b/.gitignore index 679186e..699707c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,3 @@ # Bazel /bazel-* MODULE.bazel.lock - -# For CI -/.bazelisk-bin