Skip to content

Auto env vars + Ignore Failures mode + end2end test #29

Auto env vars + Ignore Failures mode + end2end test

Auto env vars + Ignore Failures mode + end2end test #29

Workflow file for this run

name: CI
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
services:
bazel-remote:
image: buchgr/bazel-remote-cache:v1.3.4
ports:
- 9092:9092
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build CLI
run: mkdir -p bin && go build -o bin/tbc .
- name: Upload CLI
uses: actions/upload-artifact@v4
with:
name: tbc
path: bin/tbc
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.59.1
- name: Run tests
run: go test ./...
- name: Run integration tests
run: go test ./client -remote-cache-host localhost:9092
############################################################################
end2end:
runs-on: ubuntu-latest
needs: build
services:
bazel-remote:
image: buchgr/bazel-remote-cache:v1.3.4
ports:
- 9092:9092
env:
# This is required by turbo with "remoteCache": { "signature": true }
# tbc --auto-env does not set this variable.
TURBO_REMOTE_CACHE_SIGNATURE_KEY: super_secret
TBC_AUTO_ENV: true
TBC_SUMMARY: true
TBC_HOST: localhost:9092
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
sparse-checkout: |
.github
end2end
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
run_install: false
package_json_file: end2end/monorepo/package.json
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: end2end/.tool-versions
cache: 'pnpm'
cache-dependency-path: end2end/monorepo/pnpm-lock.yaml
- name: Install dependencies
run: pnpm -C end2end/monorepo install
- name: Grab tbc CLI
uses: actions/download-artifact@v4
with:
name: tbc
- name: Restore exec bit for tbc
run: chmod +x $GITHUB_WORKSPACE/tbc
- name: Build monorepo for the first time
run: cd end2end/monorepo && $GITHUB_WORKSPACE/tbc pnpm build