diff options
| author | Leitwolf | 2026-11-16 18:11:10 +0300 |
|---|---|---|
| committer | GitHub | 2026-11-16 18:11:10 +0300 |
| commit | eea3be11a9e1a047442d71626557e57c3061da1a (patch) | |
| tree | cc2934976615781eb59d66134e58efa78dfc410d /.github/workflows/validate-header-guards.yml | |
| parent | 57dc4f2fee6881884b10085e85927a0c1710ea61 (diff) | |
| parent | dacada4eeab3a6a4ef1d0898d657d60c634b8cf5 (diff) | |
| download | catch3-devel.tar.gz | |
Build against the Progmasoft remote cache
Diffstat (limited to '.github/workflows/validate-header-guards.yml')
| -rw-r--r-- | .github/workflows/validate-header-guards.yml | 21 |
1 files changed, 21 insertions, 0 deletions
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: |