Skip to content

Commit e02e1f0

Browse files
authored
cheri/ci: update cirrus config (#43)
1 parent e0a0795 commit e02e1f0

File tree

1 file changed

+47
-61
lines changed

1 file changed

+47
-61
lines changed

.cirrus.yml

Lines changed: 47 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,131 +1,117 @@
11
gcp_credentials: ENCRYPTED[5ee9e22237c8368fdae53b368a38509d62a168e1b5a8162a9bd8dfef5e874a4f41cd8235d498b99d2c2860c77e06ecd1]
22

3+
gce_instance:
4+
image_project: ubuntu-os-cloud
5+
image_family: ubuntu-2404-lts-arm64
6+
architecture: arm64
7+
zone: us-east1-b
8+
type: c4a-standard-16
9+
disk: 60
10+
spot: true
11+
312
# -- PR tasks
413

514
pr_check_commits_task:
615
skip: $CIRRUS_PR == ""
716
name: (PR) Check commits structure
17+
alias: pr_check_commits
818
timeout_in: 240m
9-
gce_instance: &arm_vm
10-
image_project: ubuntu-os-cloud
11-
image_family: ubuntu-2404-lts-arm64
12-
architecture: arm64
13-
zone: us-east1-b
14-
type: c4a-standard-16
15-
disk: 60
16-
spot: true
1719
env:
1820
GH_TOKEN: ""
1921
dependencies_script:
2022
- set -eo pipefail
2123
# No need to clone.
2224
clone_script: []
2325
test_script: |
24-
commits=$(curl -s -H "Accept: application/vnd.github+json" https://api.github.com/repos/CHERIoT-Platform/cheri-rust/pulls/$CIRRUS_PR | jq '.commits')
26+
url=https://api.github.com/repos/CHERIoT-Platform/cheri-rust/pulls/$CIRRUS_PR
27+
commits=$(curl -s -H "Accept: application/vnd.github+json" $url | jq '.commits')
2528
if [[ $commits -ne 1 ]]; then
2629
echo "Expected a single commit, found $commits"
2730
echo "In order to facilitate cherry-picking commits into other branches,"
2831
echo "please squash your commits into a single one."
2932
exit 1;
3033
fi
3134
35+
# -- End PR tasks
36+
3237
x_check_task:
3338
name: Run ./x check
39+
alias: x_check
3440
# TODO(xdoardo): Figure out when it makes sense to have this dependency, or
3541
# how that dependency should actually work. Having this dependency would
3642
# pretty much mean making every PR that merges changes on `beta` to `master`
3743
# to have failing CI, which would be the reason why we want to make PRs and
3844
# not direct pushes in the first place.
3945
# depends_on: (PR) Check commits structure
4046
timeout_in: 240m
41-
gce_instance: &arm_vm
42-
image_project: ubuntu-os-cloud
43-
image_family: ubuntu-2404-lts-arm64
44-
architecture: arm64
45-
zone: us-east1-b
46-
type: c4a-standard-16
47-
disk: 60
48-
spot: true
49-
env:
50-
CIRRUS_CLONE_DEPTH: 0
51-
5247
dependencies_script:
5348
- set -eo pipefail
5449
- apt-get update
5550
- apt-get install -y clang ninja-build lld cmake ccache perl
5651
gen_bootstrap_script: ./cheri/gen_bootstrap.sh
5752
setup_env_script:
58-
- export CCACHE_REMOTE_STORAGE="http://${CIRRUS_HTTP_CACHE_HOST}/${CIRRUS_OS}/"
59-
- export CCACHE_REMOTE_ONLY=1
60-
- env
53+
- echo "CCACHE_REMOTE_STORAGE=http://${CIRRUS_HTTP_CACHE_HOST}/${CIRRUS_OS}/" >> $CIRRUS_ENV
54+
- echo "CCACHE_REMOTE_ONLY=1" >> $CIRRUS_ENV
55+
check_env_script: env
6156
pull_master_script: git fetch origin master:refs/remotes/origin/master
6257
tidy_script: CC="clang" CXX="clang++" ./x test tidy
6358
check_script: CC="clang" CXX="clang++" ./x check
6459
ui_test_script: CC="clang" CXX="clang++" ./x test ui
6560

6661
build_core_task:
6762
name: Build `core` library for `riscv32cheriot-unknown-cheriotrtos`
63+
alias: build_core
6864
depends_on:
69-
- Run ./x check
65+
- x_check
7066
timeout_in: 240m
71-
gce_instance: &arm_vm
72-
image_project: ubuntu-os-cloud
73-
image_family: ubuntu-2404-lts-arm64
74-
architecture: arm64
75-
zone: us-east1-b
76-
type: c4a-standard-16
77-
disk: 60
78-
spot: true
7967
env:
80-
CIRRUS_CLONE_DEPTH: 0
81-
68+
CIRRUS_CLONE_DEPTH: "1"
8269
dependencies_script:
8370
- set -eo pipefail
8471
- apt-get update
8572
- apt-get install -y clang ninja-build lld cmake ccache perl
8673
gen_bootstrap_script: ./cheri/gen_bootstrap.sh
8774
setup_env_script:
88-
- export CCACHE_REMOTE_STORAGE="http://${CIRRUS_HTTP_CACHE_HOST}/${CIRRUS_OS}/"
89-
- export CCACHE_REMOTE_ONLY=1
90-
- env
91-
pull_master_script: git fetch origin master:refs/remotes/origin/master
75+
- echo "CCACHE_REMOTE_STORAGE=http://${CIRRUS_HTTP_CACHE_HOST}/${CIRRUS_OS}/" >> $CIRRUS_ENV
76+
- echo "CCACHE_REMOTE_ONLY=1" >> $CIRRUS_ENV
77+
check_env_script: env
78+
pull_master_script: git fetch origin master:refs/remotes/origin/master --depth 1
9279
build_script: CC="clang" CXX="clang++" ./x build compiler std --target=riscv32cheriot-unknown-cheriotrtos
9380

9481
run_cheri_tests_task:
9582
name: Run CHERIoT-specific tests
83+
alias: run_cheri_tests
9684
depends_on:
97-
- Build `core` library for `riscv32cheriot-unknown-cheriotrtos`
85+
- build_core
9886
timeout_in: 240m
99-
gce_instance: &arm_vm
100-
image_project: ubuntu-os-cloud
101-
image_family: ubuntu-2404-lts-arm64
102-
architecture: arm64
103-
zone: us-east1-b
104-
type: c4a-standard-16
105-
disk: 60
106-
spot: true
10787
env:
108-
CIRRUS_CLONE_DEPTH: 0
109-
CARGO_HOME: /tmp/cargo
110-
RUSTUP_HOME: /tmp/cargo
111-
XMAKE_ROOT: "y"
112-
88+
CIRRUS_CLONE_DEPTH: "1"
89+
CARGO_HOME: /tmp/cargo
90+
RUSTUP_HOME: /tmp/cargo
91+
XMAKE_ROOT: "y"
11392
dependencies_script:
11493
- set -eo pipefail
11594
- apt-get update
11695
- apt-get install -y clang ninja-build lld cmake ccache perl opam z3 libgmp-dev
11796
install_xmake_script: curl -fsSL https://xmake.io/shget.text | bash || true # The installer will fail without any informations.
118-
verify_xmake_script: /root/.local/bin/xmake -v
119-
install_rust_script: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y && . "$CARGO_HOME/env"
97+
verify_xmake_script: /root/.local/bin/xmake --version
98+
install_rust_script: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y
12099
verify_rust_script: . "$CARGO_HOME/env" && cargo --version
121-
build_sail_sim_script: git clone --recurse-submodules --depth=1 https://github.com/CHERIoT-Platform/cheriot-sail && cd cheriot-sail && opam init --reinit --bypass-check --disable-sandboxing --disable-shell-hook && eval $(opam env) && opam install sail --confirm-level=unsafe-yes && make csim && cp c_emulator/cheriot_sim /usr/local/bin
100+
build_sail_sim_script:
101+
- git clone --recurse-submodules --depth=1 https://github.com/CHERIoT-Platform/cheriot-sail
102+
- opam init --reinit --bypass-check --disable-sandboxing --disable-shell-hook
103+
- eval $(opam env)
104+
- opam install sail --confirm-level=unsafe-yes
105+
- cd cheriot-sail && make csim && cp c_emulator/cheriot_sim /usr/local/bin
122106
gen_bootstrap_script: ./cheri/gen_bootstrap.sh --build-clang
123107
setup_env_script:
124-
- export CCACHE_REMOTE_STORAGE="http://${CIRRUS_HTTP_CACHE_HOST}/${CIRRUS_OS}/"
125-
- export CCACHE_REMOTE_ONLY=1
126-
- env
127-
pull_master_script: git fetch origin master:refs/remotes/origin/master
108+
- echo "CCACHE_REMOTE_STORAGE=http://${CIRRUS_HTTP_CACHE_HOST}/${CIRRUS_OS}/" >> $CIRRUS_ENV
109+
- echo "CCACHE_REMOTE_ONLY=1" >> $CIRRUS_ENV
110+
check_env_script: env
111+
pull_master_script: git fetch origin master:refs/remotes/origin/master --depth 1
128112
build_rustc_script: CC="clang" CXX="clang++" ./x build compiler std --target=riscv32cheriot-unknown-cheriotrtos
129113
build_test_runner_script: cd ./cheri/tests/runner && . "$CARGO_HOME/env" && cargo build --release
130-
run_tests_script: cd ./cheri/tests && ./runner/target/release/cheriot-runner -vvvvv . --sysroot=../../build/host/llvm --rustc=../../build/host/stage1/bin/rustc --xmake=/root/.local/bin/xmake
131-
# -- End PR tasks
114+
run_tests_script: cd ./cheri/tests && ./runner/target/release/cheriot-runner -vvvvv .
115+
--sysroot=../../build/host/llvm
116+
--rustc=../../build/host/stage1/bin/rustc
117+
--xmake=/root/.local/bin/xmake

0 commit comments

Comments
 (0)