Skip to content

Commit

Permalink
fail if subcommand fails in CI
Browse files Browse the repository at this point in the history
Signed-off-by: Appu Goundan <[email protected]>
  • Loading branch information
loosebazooka committed Oct 29, 2023
1 parent 2d4ee60 commit b53afc8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 15 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,14 @@ jobs:
bazel --bazelrc=$GITHUB_WORKSPACE/.github/workflows/ci.bazelrc fetch //... && break || sleep 20;
done
- name: Build All Images
run: bazel --bazelrc=$GITHUB_WORKSPACE/.github/workflows/ci.bazelrc build $(bazel query 'kind(oci_image, deps(:sign_and_push))')
run: |
set -e
targets=$(bazel query 'kind(oci_image, deps(:sign_and_push))')
bazel --bazelrc=$GITHUB_WORKSPACE/.github/workflows/ci.bazelrc build $targets
- name: Unit Tests
run: bazel --bazelrc=$GITHUB_WORKSPACE/.github/workflows/ci.bazelrc test //... --build_tests_only
- name: Build Examples
run: bazel --bazelrc=$GITHUB_WORKSPACE/.github/workflows/ci.bazelrc build //examples/...

ci-images:
name: CI image tests
Expand Down
37 changes: 23 additions & 14 deletions examples/python3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,29 @@ pkg_tar(
)

# This example runs a python program that walks the filesystem under "/etc" and prints every filename.
[
oci_image(
name = "hello_" + distro,
base = "//experimental/python3:python3_root_arm64_" + distro,
cmd = [
"hello.py",
"/etc",
],
tars = [
":hello_py",
],
)
for distro in DISTROS
]
oci_image(
name = "hello_debian11",
base = "//experimental/python3:python3_root_amd64_debian11",
cmd = [
"hello.py",
"/etc",
],
tars = [
":hello_py",
],
)

oci_image(
name = "hello_debian12",
base = "//python3:python3_root_amd64_debian12",
cmd = [
"hello.py",
"/etc",
],
tars = [
":hello_py",
],
)

# Run
# podman load -i bazel-bin/examples/python3/tarball/tarball.tar
Expand Down

0 comments on commit b53afc8

Please sign in to comment.