blob: f881207df0be0d78f0116aea5a926a9d709153ea [file]
name: CI
on:
pull_request:
branches: [ main ]
schedule:
# Every day at 11:03 UTC.
- cron: '3 11 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest, windows-11-arm]
bazel_version: ['9.x', rolling]
runs-on: ${{ matrix.os }}
env:
USE_BAZEL_VERSION: ${{ matrix.bazel_version }}
steps:
- uses: actions/checkout@v7
- name: Execute Tests
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bazelisk test //...
- name: Execute Integration Tests
shell: bash
# Bazel-in-Bazel still has issues with runfiles
if: runner.os != 'Windows'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bazelisk test //:all_integration_tests
- name: Run with extra exec platforms
run: bazelisk run //:buildifier --extra_execution_platforms="//:non_host_platform,@platforms//host" '--' -help
example_simple:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
bazel_version: ['7.x', '8.x']
runs-on: ${{ matrix.os }}
env:
USE_BAZEL_VERSION: ${{ matrix.bazel_version }}
steps:
- uses: actions/checkout@v7
- name: Test
shell: bash
working-directory: examples/simple
run: bazelisk test //...
example_specify_assets:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
bazel_version: ['7.x', '8.x']
runs-on: ${{ matrix.os }}
env:
USE_BAZEL_VERSION: ${{ matrix.bazel_version }}
steps:
- uses: actions/checkout@v7
- name: Test
shell: bash
working-directory: examples/specify_assets
run: bazelisk test //...
example_bzlmod:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
bazel_version: ['7.x', '8.x', '9.x', rolling]
runs-on: ${{ matrix.os }}
env:
USE_BAZEL_VERSION: ${{ matrix.bazel_version }}
steps:
- uses: actions/checkout@v7
- name: Test
shell: bash
working-directory: examples/bzlmod
run: bazelisk test //...
example_bzlmod_specify_assets:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
bazel_version: ['9.x', rolling]
runs-on: ${{ matrix.os }}
env:
USE_BAZEL_VERSION: ${{ matrix.bazel_version }}
steps:
- uses: actions/checkout@v7
- name: Test
shell: bash
working-directory: examples/bzlmod_specify_assets
run: bazelisk test //...
result:
if: always()
needs:
- build
- example_simple
- example_specify_assets
- example_bzlmod
- example_bzlmod_specify_assets
runs-on: ubuntu-latest
steps:
- run: exit 1
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')