tazelish
Installs Tazel and chooses which version of it runs.
Clonegit clone https://git.progmasoft.com/tazelish
Build against the Progmasoft remote cache
- Commit
5cee06d1887911764fc134d84cd412bbaa574c38- Author
- Leitwolf11 ·
- Parents
3b6c73b515ef
Changes
.github/workflows/ci.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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