1

add release and build scripts

This commit is contained in:
Motiejus Jakštys
2021-10-18 15:12:31 +03:00
parent b0e83bcecc
commit 4bbae178ca
4 changed files with 86 additions and 42 deletions

View File

@@ -9,36 +9,12 @@ environment:
tasks:
- setup: |
sudo apt-get purge gcc -y && sudo apt-get autoremove -y
- lint:
cd bazel-zig-cc
shellcheck $(awk '/#!\/bin\/(ba)?sh/&&FNR==1{print FILENAME}' $(git ls-files)))
- test_list_toolchains: |
cd bazel-zig-cc; . .envrc; echo "Available toolchains:"
bazel query @zig_sdk//... | sed -En '/.*_toolchain$/ s/.*:(.*)_toolchain$/\1/p'
- test_default: |
cd bazel-zig-cc; . .envrc; ./build-and-file \
//test:hello | \
grep -q "ELF 64-bit.* x86-64.* dynamically linked"
- test_amd64-linux-gnu: |
cd bazel-zig-cc; . .envrc; ./build-and-file \
--platforms @io_bazel_rules_go//go/toolchain:linux_amd64_cgo //test:hello | \
grep -q "ELF 64-bit.* x86-64.* dynamically linked"
- test_amd64-linux-musl: |
cd bazel-zig-cc; . .envrc; ./build-and-file \
--platforms @io_bazel_rules_go//go/toolchain:linux_amd64_cgo \
--extra_toolchains @zig_sdk//:linux_amd64_musl_toolchain //test:hello | \
grep -q "ELF 64-bit.* x86-64.* statically linked"
- test_arm64-linux-gnu: |
cd bazel-zig-cc; . .envrc; ./build-and-file \
--platforms @io_bazel_rules_go//go/toolchain:linux_arm64_cgo //test:hello | \
grep -q "ELF 64-bit.* ARM aarch64.* dynamically linked"
- test_arm64-linux-musl: |
cd bazel-zig-cc; . .envrc; ./build-and-file \
--platforms @io_bazel_rules_go//go/toolchain:linux_arm64_cgo \
--extra_toolchains @zig_sdk//:linux_arm64_musl_toolchain //test:hello | \
grep -q "ELF 64-bit.* ARM aarch64.* statically linked"
- test_amd64-macos: |
cd bazel-zig-cc; . .envrc; ./build-and-file \
--platforms @io_bazel_rules_go//go/toolchain:darwin_amd64_cgo //test:hello | \
grep -q "Mach-O 64-bit x86_64 executable"
- test_arm64-macos-gnu: |
cd bazel-zig-cc; . .envrc; ./build-and-file \
--platforms @io_bazel_rules_go//go/toolchain:darwin_arm64_cgo //test:hello | \
grep -q "Mach-O 64-bit arm64 executable"
- test_hello_on_toolchains: |
cd bazel-zig-cc
./ci/test