Implement CI #83

Merged
lucas merged 5 commits from feat/cross-compile into master 2023-03-23 19:30:18 +01:00
2 changed files with 56 additions and 0 deletions
Showing only changes of commit 8b70eba79e - Show all commits

32
.ci/tasks/build.sh Executable file
View file

@ -0,0 +1,32 @@
#!/bin/sh
set -eux
OUTPUT="$1"
case "$TARGET" in
msvc)
cp /src/*.lib ./lib/oodle/
cargo build --color always --locked --release --target x86_64-pc-windows-msvc -Zbuild-std
if [ -d "$OUTPUT" ]; then
install -t "$OUTPUT/" target/x86_64-pc-windows-msvc/release/dtmt.exe
install -t "$OUTPUT/" target/x86_64-pc-windows-msvc/release/dtmm.exe
fi
;;
linux)
cp /src/*.so ./lib/oodle/
cargo build --color always --locked --profile release-lto
if [ -d "$OUTPUT" ]; then
install -t "$OUTPUT/" target/release/dtmt
install -t "$OUTPUT/" target/release/dtmm
fi
;;
*)
set +x
echo "Env var 'TARGET' must either be 'msvc' or 'linux'. Got '$TARGET'." >&2
exit 1
esac

24
.ci/tasks/build.yml Normal file
View file

@ -0,0 +1,24 @@
---
platform: linux
image_resource:
type: registry-image
source:
repository: registry.local:5000/dtmt-ci-base-((target))
tag: latest
inputs:
- name: repo
outputs:
- name: artifact
params:
CI: true
TARGET: ((target))
run:
path: .ci/tasks/build.sh
dir: repo
args:
- /artifact