Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLeitwolf112026-11-16 15:13:16 +0300
committerLeitwolf112026-11-16 15:13:16 +0300
commitdacada4eeab3a6a4ef1d0898d657d60c634b8cf5 (patch)
treecc2934976615781eb59d66134e58efa78dfc410d
parent57dc4f2fee6881884b10085e85927a0c1710ea61 (diff)
downloadcatch3-ci/remote-cache.tar.gz
Build against the Progmasoft remote cacheci/remote-cache
The Bazel jobs read from remotecache.progmasoft.com, and pushes to the default branch also write to it. The write credential reaches only those pushes; pull requests read with the read credential and upload nothing, and a pull request from a fork, which gets no secrets, builds without the cache. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ji7xZMYjc4zankoc7hGBE1
-rw-r--r--.github/workflows/bazel-builds.yml42
-rw-r--r--.github/workflows/validate-header-guards.yml21
2 files changed, 63 insertions, 0 deletions
diff --git a/.github/workflows/bazel-builds.yml b/.github/workflows/bazel-builds.yml
index f0672a7a..f42170d1 100644
--- a/.github/workflows/bazel-builds.yml
+++ b/.github/workflows/bazel-builds.yml
@@ -30,6 +30,27 @@ jobs:
bazelisk-cache: true
repository-cache: true
+ # Pushes to the default branch write to the Progmasoft remote cache and
+ # pull requests only read it; a pull request from a fork gets no secrets
+ # and builds without it.
+ - name: Use the Progmasoft remote cache
+ shell: bash
+ env:
+ WRITES: ${{ github.event_name == 'push' && github.ref_name == github.event.repository.default_branch }}
+ CACHE_READ: ${{ secrets.BAZEL_CACHE_READ }}
+ CACHE_WRITE: ${{ github.event_name == 'push' && github.ref_name == github.event.repository.default_branch && secrets.BAZEL_CACHE_WRITE || '' }}
+ run: |
+ auth=$([ "$WRITES" = true ] && echo "$CACHE_WRITE" || echo "$CACHE_READ")
+ if [ -z "$auth" ]; then
+ echo "No cache credentials: building without the remote cache."
+ exit 0
+ fi
+ {
+ echo "common --remote_cache=https://remotecache.progmasoft.com"
+ echo "common --remote_header=\"Authorization=Basic $auth\""
+ [ "$WRITES" = true ] || echo "common --remote_upload_local_results=false"
+ } >> "$HOME/.bazelrc"
+
- name: Run Progmasoft property tests on Windows
if: runner.os == 'Windows'
run: bazel test tests/Progmasoft:property_tests
@@ -64,6 +85,27 @@ jobs:
bazelisk-cache: true
repository-cache: true
+ # Pushes to the default branch write to the Progmasoft remote cache and
+ # pull requests only read it; a pull request from a fork gets no secrets
+ # and builds without it.
+ - name: Use the Progmasoft remote cache
+ shell: bash
+ env:
+ WRITES: ${{ github.event_name == 'push' && github.ref_name == github.event.repository.default_branch }}
+ CACHE_READ: ${{ secrets.BAZEL_CACHE_READ }}
+ CACHE_WRITE: ${{ github.event_name == 'push' && github.ref_name == github.event.repository.default_branch && secrets.BAZEL_CACHE_WRITE || '' }}
+ run: |
+ auth=$([ "$WRITES" = true ] && echo "$CACHE_WRITE" || echo "$CACHE_READ")
+ if [ -z "$auth" ]; then
+ echo "No cache credentials: building without the remote cache."
+ exit 0
+ fi
+ {
+ echo "common --remote_cache=https://remotecache.progmasoft.com"
+ echo "common --remote_header=\"Authorization=Basic $auth\""
+ [ "$WRITES" = true ] || echo "common --remote_upload_local_results=false"
+ } >> "$HOME/.bazelrc"
+
- name: Test the module as a user's module depends on it
working-directory: tests/Progmasoft/BazelModule
run: bazel test //...
diff --git a/.github/workflows/validate-header-guards.yml b/.github/workflows/validate-header-guards.yml
index bceb79ae..27080040 100644
--- a/.github/workflows/validate-header-guards.yml
+++ b/.github/workflows/validate-header-guards.yml
@@ -24,6 +24,27 @@ jobs:
bazelisk-cache: true
repository-cache: true
+ # Pushes to the default branch write to the Progmasoft remote cache and
+ # pull requests only read it; a pull request from a fork gets no secrets
+ # and builds without it.
+ - name: Use the Progmasoft remote cache
+ shell: bash
+ env:
+ WRITES: ${{ github.event_name == 'push' && github.ref_name == github.event.repository.default_branch }}
+ CACHE_READ: ${{ secrets.BAZEL_CACHE_READ }}
+ CACHE_WRITE: ${{ github.event_name == 'push' && github.ref_name == github.event.repository.default_branch && secrets.BAZEL_CACHE_WRITE || '' }}
+ run: |
+ auth=$([ "$WRITES" = true ] && echo "$CACHE_WRITE" || echo "$CACHE_READ")
+ if [ -z "$auth" ]; then
+ echo "No cache credentials: building without the remote cache."
+ exit 0
+ fi
+ {
+ echo "common --remote_cache=https://remotecache.progmasoft.com"
+ echo "common --remote_header=\"Authorization=Basic $auth\""
+ [ "$WRITES" = true ] || echo "common --remote_upload_local_results=false"
+ } >> "$HOME/.bazelrc"
+
- name: Test the tools
run: bazel test //tools:tools_tests
env: