Skip to content

Commit 0ee392b

Browse files
committed
make buildign distro conditional"
1 parent 94213fd commit 0ee392b

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

.github/workflows/checks.sh

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22

33
set -o pipefail
44

5-
bazel build //distro:distro
6-
exit_code="$?"
7-
if [ "${exit_code}" -ne 0 ] ; then
8-
exit "${exit_code}"
9-
fi
105

116
FILTERS=()
127
if [[ -n "${TEST_FILTER:-}" ]] ; then
@@ -16,14 +11,18 @@ fi
1611
echo bazel test "${FILTERS[@]}" -- //tests/... //examples/... -//tests/rpm/...
1712
bazel test "${FILTERS[@]}" -- //tests/... //examples/... -//tests/rpm/...
1813
exit_code="$?"
19-
case "${exit_code}" in
20-
"4")
21-
# Status code indicates that the build succeeded but there were no tests to
22-
# run. Ignore and exit successfully.
23-
exit "0"
24-
;;
2514

26-
*)
15+
if [ "${exit_code}" -ne 0 ] ; then
2716
exit "${exit_code}"
28-
;;
29-
esac
17+
fi
18+
19+
if [ -n "${BUILD_DISTRO:-}" ] ; then
20+
bazel build //distro:distro
21+
exit_code="$?"
22+
if [ "${exit_code}" -ne 0 ] ; then
23+
echo "Could not build //distro:distro"
24+
exit "${exit_code}"
25+
fi
26+
fi
27+
28+
exit "${exit_code}"

.github/workflows/checks.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ jobs:
2424
include:
2525
- name: "Bazel 8.x: @rules_pkg (Linux x64)"
2626
bazel_version: "8.x"
27+
build_distro: "true"
2728
filter: ""
2829
runner: "ubuntu-latest"
2930

3031
- name: "Bazel 7.x: @rules_pkg (Linux x64)"
3132
bazel_version: "7.x"
33+
build_distro: ""
3234
filter: "-REQUIRES_BAZEL_8"
3335
runner: "ubuntu-latest"
3436

@@ -41,6 +43,7 @@ jobs:
4143
- name: "Run (Bash)"
4244
working-directory: "${{ github.workspace }}"
4345
env:
46+
BUILD_DISTRO: "${{ matrix.build_distro }}"
4447
USE_BAZEL_VERSION: "${{ matrix.bazel_version }}"
4548
TEST_FILTER: "${{ matrix.filter }}"
4649
run: bash "${{ github.workspace }}/.github/workflows/checks.sh"

0 commit comments

Comments
 (0)