-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.ci.yml
50 lines (46 loc) · 1.45 KB
/
.ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
stages:
- test
.common_triggers: &common_triggers
only:
variables:
- $CI_COMMIT_REF_NAME == "master"
- $CI_PIPELINE_SOURCE == "merge_request"
variables:
BAZELISK_URL: https://github.com/bazelbuild/bazelisk/releases/download/v1.20.0/bazelisk-linux-amd64
.install_bazelisk: &install_bazelisk |-
apt-get -qqy update > /dev/null && \
apt-get -qqy --no-install-recommends install ca-certificates python3 build-essential clang git file zip wget && \
wget -nv "$BAZELISK_URL" -O /usr/local/bin/bazelisk && \
chmod +x /usr/local/bin/bazelisk
.default_bazel_version: &default_bazel_version
USE_BAZEL_VERSION: 7.4.1
test_examples:
image: debian:12-slim
stage: test
<<: *common_triggers
variables:
<<: *default_bazel_version
before_script:
- *install_bazelisk
script:
- useradd -m non_root
- chmod a+w -R .
- pushd examples/cortex-r52
# rules_python doesn't support a hermetic toolchain run by root
- su non_root -c "bazelisk test //:all"
- ls bazel-testlogs/*/test.outputs/outputs.zip
- popd
- pushd examples/failing-test
- su non_root -c "! bazelisk test //:all > test.log || exit 1"
- ls bazel-testlogs/*/test.outputs/outputs.zip
- grep -E "//:success-test +PASSED" test.log
- grep -E "//:failing-test +FAILED" test.log
- popd
after_script:
- mkdir artifacts
- cp -LR examples/*/bazel-testlogs/* artifacts
artifacts:
when:
always
paths:
- artifacts