@@ -24,30 +24,11 @@ concurrency:
2424 cancel-in-progress : true
2525
2626jobs :
27- # 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-
4327 foss_ubuntu_test :
44- name : " Test rules on FOSS projects Bazel: ${{ matrix.bazel_version }} (ubuntu)"
28+ name : " Test rules on FOSS projects (ubuntu)"
4529 runs-on : ubuntu-24.04
46- needs : load_versions
4730 strategy :
4831 fail-fast : false
49- matrix :
50- bazel_version : ${{ fromJson(needs.load_versions.outputs.bazel_version) }}
5132
5233 steps :
5334 - name : Checkout repository
@@ -56,24 +37,29 @@ jobs:
5637 - name : Setup environment
5738 uses : ./.github/platform_environment_setup/ubuntu
5839
59- - name : Set Bazel version
60- run : echo ${{ matrix.bazel_version }} >> test/foss/templates/.bazelversion
61-
6240 - name : Run Test On Opensource Projects
63- working-directory : test
64- run : python3 -m unittest foss/test_foss.py -vvv
41+ run : |
42+ VERSIONS=$(jq -rc '.[]' bazel_version.json)
43+
44+ for VERSION in $VERSIONS; do
45+ echo "------------------------------------------------"
46+ echo "STARTING TEST FOR BAZEL VERSION: $VERSION"
47+ echo "------------------------------------------------"
48+ echo "$VERSION" > .bazelversion
49+ cd test
50+ # TODO: Remove when not necessary anymore
51+ rm -rf foss/*/test-proj
52+ python3 -m unittest discover foss -vvv
53+ done
6554
6655 foss_rhel_test :
67- name : " Test rules on FOSS projects Bazel ${{ matrix.bazel_version }} (RHEL)"
56+ name : " Test rules on FOSS projects (RHEL)"
6857 runs-on : ubuntu-24.04
6958 container :
7059 image : redhat/ubi9:latest
7160 options : --init
72- needs : load_versions
7361 strategy :
7462 fail-fast : false
75- matrix :
76- bazel_version : ${{ fromJson(needs.load_versions.outputs.bazel_version) }}
7763
7864 steps :
7965 - name : Checkout repository
8268 - name : Setup environment
8369 uses : ./.github/platform_environment_setup/rhel9
8470
85- - name : Set Bazel version
86- run : echo ${{ matrix.bazel_version }} >> test/foss/templates/.bazelversion
87-
8871 - name : Run Test On Opensource Projects
89- working-directory : test
90- run : runuser -u test -- python3 -m unittest foss/test_foss.py -vvv
72+ run : |
73+ VERSIONS=$(jq -rc '.[]' bazel_version.json)
74+
75+ for VERSION in $VERSIONS; do
76+ echo "------------------------------------------------"
77+ echo "STARTING TEST FOR BAZEL VERSION: $VERSION"
78+ echo "------------------------------------------------"
79+ echo "$VERSION" > .bazelversion
80+ cd test
81+ # TODO: Remove when not necessary anymore
82+ rm -rf foss/*/test-proj
83+ python3 -m unittest discover foss -vvv
84+ done
0 commit comments