Skip to content

Commit

Permalink
Merge presubmit and build_binaries scripts
Browse files Browse the repository at this point in the history
This allows Kokoro to do all the steps at once
  • Loading branch information
tiziano88 committed Jun 28, 2023
1 parent 71c575e commit 55aa909
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 24 deletions.
6 changes: 6 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ oak_restricted_kernel_simple_io_bin:

stage0_bin:
env --chdir=stage0_bin cargo objcopy --release -- --output-target=binary target/x86_64-unknown-none/release/stage0_bin

# Top level target to build all enclave apps and the kernel, and run tests.
#
# This is the entry point for Kokoro CI.
kokoro: all_enclave_apps oak_restricted_kernel_bin stage0_bin
cargo nextest run --all-targets --hide-progress-bar
22 changes: 0 additions & 22 deletions kokoro/build_binaries.sh

This file was deleted.

11 changes: 9 additions & 2 deletions kokoro/presubmit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,17 @@ export RUST_BACKTRACE=1
export RUST_LOG=debug
export XDG_RUNTIME_DIR=/var/run

ls -alsR "$KOKORO_ARTIFACTS_DIR"

./scripts/docker_pull
# --all-targets is needed to also run tests for examples and benches.
./scripts/docker_run nix develop .#ci --command cargo nextest run --all-targets --hide-progress-bar
./scripts/docker_run nix develop .#ci --command just oak_restricted_kernel_bin

mkdir "$KOKORO_ARTIFACTS_DIR/test_logs/"
cp ./target/nextest/default/*.xml "$KOKORO_ARTIFACTS_DIR/test_logs/"
ls -als "$KOKORO_ARTIFACTS_DIR"

# Copy the generated binaries to Placer.
mkdir -p "$KOKORO_ARTIFACTS_DIR/binaries/oak_restricted_kernel_bin"
cp ./oak_restricted_kernel_bin/target/x86_64-unknown-none/release/oak_restricted_kernel_bin "$KOKORO_ARTIFACTS_DIR/binaries/oak_restricted_kernel_bin/${KOKORO_GIT_COMMIT_oak:?}"

ls -alsR "$KOKORO_ARTIFACTS_DIR"

0 comments on commit 55aa909

Please sign in to comment.