Test examples #254
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 examples | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
jobs: | |
test_main: | |
runs-on: ubuntu-latest | |
env: | |
BAZELISK_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Test | |
run: bazelisk test //... | |
- name: Upload test logs | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: testlogs | |
# https://github.com/actions/upload-artifact/issues/92#issuecomment-711107236 | |
path: | | |
${{ github.workspace }}/bazel-testlogs*/**/test.log | |
test_examples: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
bazel: [7.x, 8.0.0rc2, last_green] | |
os: [ubuntu-latest, macos-13, macos-latest] | |
env: | |
BAZELISK_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Test examples | |
env: | |
USE_BAZEL_VERSION: ${{ matrix.bazel }} | |
working-directory: ./examples | |
# Build first because the tests rely on convenience symlinks. | |
run: bazelisk build //... && bazelisk test //... | |
- name: Upload test logs | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: testlogs-${{ matrix.bazel}}-${{ matrix.os }} | |
# https://github.com/actions/upload-artifact/issues/92#issuecomment-711107236 | |
path: | | |
${{ github.workspace }}/examples/bazel-testlogs*/**/test.log |