Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/bazel_version.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
"6.5.0",
"7.7.0"
]

1 change: 1 addition & 0 deletions .github/platform_environment_setup/rhel9/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ runs:
gcc \
g++ \
scl-utils \
jq \
shell: bash

- name: Install CodeChecker
Expand Down
68 changes: 34 additions & 34 deletions .github/workflows/foss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,11 @@ concurrency:
cancel-in-progress: true

jobs:
# TODO: Parallelize the running of projects
load_versions:
name: "Load bazel versions for FOSS tests"
runs-on: ubuntu-24.04
outputs:
bazel_version: ${{ steps.generate_matrix.outputs.matrix_json }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Load versions
id: generate_matrix
run: |
JSON=$(jq -c . ./.github/bazel_version.json)
echo "matrix_json=$JSON" >> $GITHUB_OUTPUT

foss_ubuntu_test:
name: "Test rules on FOSS projects Bazel: ${{ matrix.bazel_version }} (ubuntu)"
name: "Test rules on FOSS projects (ubuntu)"
runs-on: ubuntu-24.04
needs: load_versions
strategy:
fail-fast: false
matrix:
bazel_version: ${{ fromJson(needs.load_versions.outputs.bazel_version) }}

steps:
- name: Checkout repository
Expand All @@ -56,24 +37,32 @@ jobs:
- name: Setup environment
uses: ./.github/platform_environment_setup/ubuntu

- name: Set Bazel version
run: echo ${{ matrix.bazel_version }} >> test/foss/templates/.bazelversion

- name: Run Test On Opensource Projects
working-directory: test
run: python3 -m unittest foss/test_foss.py -vvv
run: |
VERSIONS=$(jq -rc '.[]' .github/bazel_version.json)

for VERSION in $VERSIONS; do
echo "------------------------------------------------"
echo "STARTING TEST FOR BAZEL VERSION: $VERSION"
echo "------------------------------------------------"
echo "$VERSION" > .bazelversion
# Use a subshell to reset directory in each iteration
(
cd test
# TODO: Remove when not necessary anymore
rm -rf foss/*/test-proj
python3 -m unittest discover foss -vvv
)
done

foss_rhel_test:
name: "Test rules on FOSS projects Bazel ${{ matrix.bazel_version }} (RHEL)"
name: "Test rules on FOSS projects (RHEL)"
runs-on: ubuntu-24.04
container:
image: redhat/ubi9:latest
options: --init
needs: load_versions
strategy:
fail-fast: false
matrix:
bazel_version: ${{ fromJson(needs.load_versions.outputs.bazel_version) }}

steps:
- name: Checkout repository
Expand All @@ -82,9 +71,20 @@ jobs:
- name: Setup environment
uses: ./.github/platform_environment_setup/rhel9

- name: Set Bazel version
run: echo ${{ matrix.bazel_version }} >> test/foss/templates/.bazelversion

- name: Run Test On Opensource Projects
working-directory: test
run: runuser -u test -- python3 -m unittest foss/test_foss.py -vvv
run: |
VERSIONS=$(jq -rc '.[]' .github/bazel_version.json)

for VERSION in $VERSIONS; do
echo "------------------------------------------------"
echo "STARTING TEST FOR BAZEL VERSION: $VERSION"
echo "------------------------------------------------"
echo "$VERSION" > .bazelversion
# Use a subshell to reset directory in each iteration
(
cd test
# TODO: Remove when not necessary anymore
rm -rf foss/*/test-proj
python3 -m unittest discover foss -vvv
)
done
64 changes: 31 additions & 33 deletions .github/workflows/unit_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,38 +24,16 @@ concurrency:
cancel-in-progress: true

jobs:
load_versions:
name: "Load bazel versions for Unit tests"
runs-on: ubuntu-24.04
outputs:
bazel_version: ${{ steps.generate_matrix.outputs.matrix_json }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Load versions
id: generate_matrix
run: |
JSON=$(jq -c . ./.github/bazel_version.json)
echo "matrix_json=$JSON" >> $GITHUB_OUTPUT

ubuntu_test:
name: "Unit tests: Bazel ${{ matrix.bazel_version }} (Ubuntu)"
name: "Unit tests (Ubuntu)"
runs-on: ubuntu-24.04
needs: load_versions
strategy:
fail-fast: false
matrix:
bazel_version: ${{ fromJson(needs.load_versions.outputs.bazel_version) }}

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/ubuntu

Expand All @@ -68,22 +46,30 @@ jobs:
"Be sure to double check during debugging."
CodeChecker analyzers

- name: Run tests
- name: Run Tests
run: |
cd test
python3 -m unittest discover unit -vvv
VERSIONS=$(jq -rc '.[]' .github/bazel_version.json)

for VERSION in $VERSIONS; do
echo "------------------------------------------------"
echo "STARTING TEST FOR BAZEL VERSION: $VERSION"
echo "------------------------------------------------"
echo "$VERSION" > .bazelversion
# Use a subshell to reset directory in each iteration
(
cd test
python3 -m unittest discover unit -vvv
)
done

rhel9_test:
name: "Unit tests: Bazel ${{ matrix.bazel_version }} (RHEL9)"
name: "Unit tests (RHEL9)"
runs-on: ubuntu-24.04
container:
image: redhat/ubi9:latest
options: --init
needs: load_versions
strategy:
fail-fast: false
matrix:
bazel_version: ${{ fromJson(needs.load_versions.outputs.bazel_version) }}

steps:
- name: Checkout repository
Expand All @@ -105,7 +91,19 @@ jobs:
"Be sure to double check during debugging."
CodeChecker analyzers

- name: Run tests

- name: Run Tests
run: |
cd test
runuser -u test -- python3 -m unittest discover unit -vvv
VERSIONS=$(jq -rc '.[]' .github/bazel_version.json)

for VERSION in $VERSIONS; do
echo "------------------------------------------------"
echo "STARTING TEST FOR BAZEL VERSION: $VERSION"
echo "------------------------------------------------"
echo "$VERSION" > .bazelversion
# Use a subshell to reset directory in each iteration
(
cd test
runuser -u test -- python3 -m unittest discover unit -vvv
)
done