Skip to content

Commit 82015f7

Browse files
committed
Add bazel version file
1 parent bc1d09e commit 82015f7

3 files changed

Lines changed: 56 additions & 6 deletions

File tree

.github/bazel_version.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[
2+
"6.5.0"
3+
]
4+

.github/workflows/foss.yaml

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,29 @@ concurrency:
2525

2626
jobs:
2727
# TODO: Parallelize the running of projects
28+
load_versions:
29+
name: "Load bazel versions for FOSS tests"
30+
runs-on: ubuntu-24.04
31+
outputs:
32+
bazel_version: ${{ steps.generate_matrix.outputs.matrix_json }}
33+
steps:
34+
- name: Checkout repository
35+
uses: actions/checkout@v4
36+
37+
- name: Load versions
38+
id: generate_matrix
39+
run: |
40+
JSON=$(jq -c . ./.github/bazel_version.json)
41+
echo "matrix_json=$JSON" >> $GITHUB_OUTPUT
42+
2843
foss_ubuntu_test:
29-
name: "Test rules on FOSS projects (ubuntu)"
44+
name: "Test rules on FOSS projects Bazel: ${{ matrix.bazel_version }} (ubuntu)"
3045
runs-on: ubuntu-24.04
46+
needs: load_versions
47+
strategy:
48+
fail-fast: false
49+
matrix:
50+
bazel_version: ${{ fromJson(needs.load_versions.outputs.bazel_version) }}
3151

3252
steps:
3353
- name: Checkout repository
@@ -36,14 +56,22 @@ jobs:
3656
- name: Setup environment
3757
uses: ./.github/platform_environment_setup/ubuntu
3858

59+
- name: Set Bazel version
60+
run: echo ${{ matrix.bazel_version }} >> test/foss/templates/.bazelversion
61+
3962
- name: Run Test On Opensource Projects
4063
working-directory: test
4164
run: python3 -m unittest foss/test_foss.py -vvv
4265

4366
foss_rhel_test:
44-
name: "Test rules on FOSS projects (RHEL)"
67+
name: "Test rules on FOSS projects Bazel ${{ matrix.bazel_version }} (RHEL)"
4568
runs-on: ubuntu-24.04
4669
container: redhat/ubi9:latest
70+
needs: load_versions
71+
strategy:
72+
fail-fast: false
73+
matrix:
74+
bazel_version: ${{ fromJson(needs.load_versions.outputs.bazel_version) }}
4775

4876
steps:
4977
- name: Checkout repository
@@ -52,6 +80,9 @@ jobs:
5280
- name: Setup environment
5381
uses: ./.github/platform_environment_setup/rhel9
5482

83+
- name: Set Bazel version
84+
run: echo ${{ matrix.bazel_version }} >> test/foss/templates/.bazelversion
85+
5586
- name: Run Test On Opensource Projects
5687
working-directory: test
5788
run: python3 -m unittest foss/test_foss.py -vvv

.github/workflows/unit_test.yaml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,29 @@ concurrency:
2424
cancel-in-progress: true
2525

2626
jobs:
27+
load_versions:
28+
name: "Load bazel versions for Unit tests"
29+
runs-on: ubuntu-24.04
30+
outputs:
31+
bazel_version: ${{ steps.generate_matrix.outputs.matrix_json }}
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v4
35+
36+
- name: Load versions
37+
id: generate_matrix
38+
run: |
39+
JSON=$(jq -c . ./.github/bazel_version.json)
40+
echo "matrix_json=$JSON" >> $GITHUB_OUTPUT
41+
2742
ubuntu_test:
2843
name: "Unit tests: Bazel ${{ matrix.bazel_version }} (Ubuntu)"
2944
runs-on: ubuntu-24.04
30-
45+
needs: load_versions
3146
strategy:
3247
fail-fast: false
3348
matrix:
34-
bazel_version: ["6.5.0"]
49+
bazel_version: ${{ fromJson(needs.load_versions.outputs.bazel_version) }}
3550

3651
steps:
3752
- name: Checkout repository
@@ -62,11 +77,11 @@ jobs:
6277
name: "Unit tests: Bazel ${{ matrix.bazel_version }} (RHEL9)"
6378
runs-on: ubuntu-24.04
6479
container: redhat/ubi9:latest
65-
80+
needs: load_versions
6681
strategy:
6782
fail-fast: false
6883
matrix:
69-
bazel_version: ["6.5.0"]
84+
bazel_version: ${{ fromJson(needs.load_versions.outputs.bazel_version) }}
7085

7186
steps:
7287
- name: Checkout repository

0 commit comments

Comments
 (0)