Prepare unittests to be extended with different bazel versions#115
Prepare unittests to be extended with different bazel versions#115Szelethus merged 2 commits intoEricsson:mainfrom
Conversation
|
Currently, the bazel versions are declared for each job separately. A) Load versions from a fileTo have the versions loaded from the same source, I would need to introduce a separate setup job. B) Combine all jobs into 1 large, meta jobAlternatively, we could merge the two jobs and have the matrix strategy also generate the separate OS dynamically. jobs:
unified_test:
name: "${{ matrix.config.label }} / Bazel ${{ matrix.bazel_version }}"
runs-on: ubuntu-24.04
container:
image: ${{ matrix.config.image }}
strategy:
fail-fast: false
matrix:
bazel_version: ["6.5.0", "7.0.0"]
config:
- label: "Ubuntu"
image: "ubuntu:24.04"
setup_dir: "ubuntu"
- label: "RHEL9"
image: "redhat/ubi9:latest"
setup_dir: "rhel9"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set bazel version to ${{ matrix.bazel_version }}
run: echo "${{ matrix.bazel_version }}" > .bazelversion
shell: bash
- name: Setup environment
uses: ./.github/platform_environment_setup/${{ matrix.config.setup_dir }}C) Use alternative solutions:
|
d23ee88 to
1e66681
Compare
1e66681 to
82015f7
Compare
|
I have gone ahead with option A |
Szelethus
left a comment
There was a problem hiding this comment.
This looks like a very elegant solution! LGTM!
Why:
We want to support multiple Bazel versions simultaneously.
We should run our test suite on all supported Bazel versions.
What:
Added a matrix strategy to both of the unittest jobs.
.github/bazel_version.jsoncontains a list of bazel versions to be used during testing.Addresses:
#108