Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert: do not cache it at all, as it has not improved #8

Merged
merged 1 commit into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 6 additions & 42 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Bazel
/bazel-*
MODULE.bazel.lock

# For CI
/.bazelisk-bin