Skip to content

Commit

Permalink
fix: use matrix to try multiple bazel versions and OSes
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyawk committed Apr 11, 2024
1 parent 4ddd80d commit 8d4bd69
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
1 change: 0 additions & 1 deletion .bazeliskrc

This file was deleted.

10 changes: 10 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
---
name: Set up environment

inputs:
bazel-version:
description: Bazel version
required: true

runs:
using: composite
steps:
- name: Generate .bazeliskrc
shell: bash
run: |
echo ${{ inputs.bazel-version }} > .bazeliskrc
echo ${{ inputs.bazel-version }} > examples/.bazeliskrc
- name: Install bazelisk
shell: bash
run: |
Expand Down
28 changes: 25 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,53 @@ concurrency:

jobs:
unit-test:
runs-on: ubuntu-20.04
strategy:
matrix:
bazel-version:
- 6.5.0
- 7.1.1
runner:
- ubuntu-20.04
- ubuntu-22.04
- macos-13
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Set up
uses: ./.github/actions/setup
with:
bazel-version: ${{ matrix.bazel-version }}
- name: Run unit tests
run: ./scripts/execute_tests.bash

example:
runs-on: ubuntu-20.04
strategy:
matrix:
bazel-version:
- 6.5.0
- 7.1.1
runner:
- ubuntu-20.04
- ubuntu-22.04
- macos-13
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Set up
uses: ./.github/actions/setup
with:
bazel-version: ${{ matrix.bazel-version }}
- name: Validate example
run: ./scripts/validate_example.bash

style-check:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Bazel
/bazel-*
MODULE.bazel.lock
.bazeliskrc

0 comments on commit 8d4bd69

Please sign in to comment.