-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
80 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
VERSION 0.7 | ||
|
||
# Set up our target toolchains, and copy our files. | ||
builder: | ||
FROM ./../../earthly/rust+rust-base | ||
|
||
COPY --dir "*" . | ||
|
||
DO ./../../earthly/rust+SETUP | ||
|
||
# Test rust build container - Use best architecture host tools. | ||
check-hosted: | ||
FROM +builder | ||
|
||
DO ./../../earthly/rust+CHECK | ||
|
||
# Test which runs check with all supported host tooling. Needs qemu or rosetta to run. | ||
# Only used to validate tooling is working across host toolsets. | ||
check-all-hosts: | ||
BUILD --platform=linux/amd64 --platform=linux/arm64 +check-hosted | ||
|
||
build-hosted: | ||
ARG TARGETPLATFORM | ||
|
||
# Build the service | ||
FROM +builder | ||
|
||
RUN /scripts/std_build.sh | ||
|
||
DO +SMOKE_TEST --bin=hello_world | ||
|
||
SAVE ARTIFACT target/$TARGETARCH/doc doc | ||
SAVE ARTIFACT target/$TARGETARCH/release/hello_world hello_world | ||
|
||
# Test which runs check with all supported host tooling. Needs qemu or rosetta to run. | ||
# Only used to validate tooling is working across host toolsets. | ||
build-all-hosts: | ||
BUILD --platform=linux/amd64 --platform=linux/arm64 +build-hosted | ||
|
||
## ----------------------------------------------------------------------------- | ||
## | ||
## Standard CI targets. | ||
## | ||
## These targets are discovered and executed automatically by CI. | ||
|
||
# Run check using the most efficient host tooling | ||
# CI Automated Entry point. | ||
check: | ||
FROM busybox | ||
# This is necessary to pick the correct architecture build to suit the native machine. | ||
# It primarily ensures that Darwin/Arm builds work as expected without needing x86 emulation. | ||
# All target implementation of this should follow this pattern. | ||
ARG USERARCH | ||
|
||
IF [ "$USERARCH" == "arm64" ] | ||
BUILD --platform=linux/arm64 +check-hosted | ||
ELSE | ||
BUILD --platform=linux/amd64 +check-hosted | ||
END | ||
|
||
# Run build using the most efficient host tooling | ||
# CI Automated Entry point. | ||
build: | ||
FROM busybox | ||
# This is necessary to pick the correct architecture build to suit the native machine. | ||
# It primarily ensures that Darwin/Arm builds work as expected without needing x86 emulation. | ||
# All target implementation of this should follow this pattern. | ||
ARG USERARCH | ||
|
||
IF [ "$USERARCH" == "arm64" ] | ||
BUILD --platform=linux/arm64 +build-hosted | ||
ELSE | ||
BUILD --platform=linux/amd64 +build-hosted | ||
END | ||
|
||
# This step simulates the full CI run for local purposes only. | ||
local-ci-run: | ||
BUILD +check | ||
BUILD +build |
This file was deleted.
Oops, something went wrong.