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

summaryrefslogtreecommitdiffhomepage
path: root/.github
diff options
context:
space:
mode:
authorLeitwolf2026-11-16 18:11:39 +0300
committerGitHub2026-11-16 18:11:39 +0300
commita81090c7362af7cb3f20964f3ac11d4bd64b3f6f (patch)
treec219efa998fb8d890f7988ad88873d188fd2fb10 /.github
parent3b6c73b515eff6a176cbdae712ae9c0ef41a1678 (diff)
parent5cee06d1887911764fc134d84cd412bbaa574c38 (diff)
downloadtazelish-main.tar.gz
Merge pull request #14 from Progmasoft/ci/remote-cacheHEADmain
Build against the Progmasoft remote cache
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/ci.yml21
1 files changed, 21 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 2046393..7840607 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -33,6 +33,27 @@ jobs:
- if: runner.os == 'Windows'
shell: pwsh
run: '"BAZEL_LLVM=C:\Program Files\LLVM" | Out-File -FilePath $env:GITHUB_ENV -Append'
+ # 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"
+
- run: bazelisk test //...
- run: bazelisk build //:tazelish