e2e: add an actual test #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
env: | |
XDG_CACHE_HOME: ~/.cache/bazel-repo | |
jobs: | |
pre-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Mount bazel caches | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/bazel | |
~/.cache/bazel-repo | |
key: bazel-cache-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', 'WORKSPACE') }} | |
restore-keys: bazel-cache- | |
- name: bazel test //:setup | |
run: > | |
bazel | |
--bazelrc=${{ github.workspace }}/.bazelrc | |
--bazelrc=${{ github.workspace }}/.github/workflows/ci.bazelrc | |
test //:setup | |
test: | |
needs: ["pre-test"] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
bazelversion: | |
- 6.4.0 | |
- 7.0.0 | |
folder: | |
- "." | |
- "e2e" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Mount bazel caches | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/bazel | |
~/.cache/bazel-repo | |
key: bazel-cache-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', 'WORKSPACE') }} | |
restore-keys: bazel-cache- | |
- name: bazel version | |
working-directory: ${{ matrix.folder }} | |
env: | |
USE_BAZEL_VERSION: ${{ matrix.bazelversion }} | |
run: bazel version | |
- name: bazel test //... | |
working-directory: ${{ matrix.folder }} | |
env: | |
USE_BAZEL_VERSION: ${{ matrix.bazelversion }} | |
run: > | |
bazel | |
--bazelrc=${{ github.workspace }}/.bazelrc | |
--bazelrc=${{ github.workspace }}/.github/workflows/ci.bazelrc | |
test //... |