-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace buildkite with github actions
Thus we gain Windows and MacOS hosts.
- Loading branch information
Motiejus Jakštys
committed
Feb 13, 2024
1 parent
2889b7b
commit 0cd9acc
Showing
4 changed files
with
68 additions
and
62 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,62 @@ | ||
--- | ||
name: ci | ||
on: | ||
push: | ||
pull_request: | ||
defaults: | ||
run: | ||
shell: bash | ||
concurrency: | ||
# Cancels pending runs when a PR gets updated. | ||
group: ${{ github.head_ref || github.run_id }}-${{ github.actor }} | ||
cancel-in-progress: true | ||
jobs: | ||
|
||
build-and-test: | ||
strategy: | ||
matrix: | ||
os: [windows-latest, ubuntu-latest, macos-13, macos-14] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
fetch-tags: true | ||
- uses: actions/cache@v4 | ||
name: cache bazelisk and zig-cache directories | ||
with: | ||
key: cache-${{ runner.os }}-${{ hashFiles('.bazelversion', 'toolchain/private/zig_sdk.bzl', '.github/workflows/ci.yaml') }} | ||
path: | | ||
${{ runner.os == 'Windows' && 'C:\Temp\hermetic_cc_toolchain' || '/tmp/zig-cache' }} | ||
${{ runner.os == 'Windows' && '~\AppData\Local\bazelisk' || '~/.cache/bazelisk' }} | ||
- run: brew install bash | ||
if: runner.os == 'macOS' | ||
|
||
# Linux, macOS and Windows | ||
- run: ci/list_toolchains_platforms | ||
- run: ci/zig-utils | ||
|
||
# Linux and macOS | ||
- run: ci/release | ||
if: runner.os == 'Linux' || runner.os == 'macOS' | ||
- run: ci/lint | ||
if: runner.os == 'Linux' || runner.os == 'macOS' | ||
# TODO: releaser is broken on windows | ||
- run: ci/prepare_git && ci/test_example rules_cc override_repository | ||
if: runner.os == 'Linux' || runner.os == 'macOS' | ||
|
||
# Linux and Windows | ||
- run: tools/bazel build --config=darwin_toolchains //... | ||
if: runner.os == 'Linux' || runner.os == 'Windows' | ||
|
||
# Linux | ||
- run: ci/test --config=darwin_toolchains | ||
if: runner.os == 'Linux' | ||
# TODO windows: broken releaser. MacOS: cgo. | ||
- run: ci/prepare_git && ci/test_example bzlmod override_module | ||
if: runner.os == 'Linux' | ||
|
||
# macOS | ||
- run: tools/bazel build --config=darwin_toolchains --build_tag_filters=darwin_c //... | ||
if: runner.os == 'macOS' |
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 |
---|---|---|
@@ -1,43 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright 2023 Uber Technologies, Inc. | ||
# Licensed under the MIT License | ||
|
||
set -xeuo pipefail | ||
|
||
echo "--- which zig" | ||
ZIG=${ZIG:-$(tools/bazel run "$@" --run_under=echo @zig_sdk//:zig)} | ||
|
||
for zigfile in $(git ls-files '*.zig'); do | ||
echo "--- compile $zigfile for various architectures" | ||
for target in \ | ||
aarch64-linux-gnu.2.28 \ | ||
aarch64-macos-none \ | ||
x86_64-linux-gnu.2.28 \ | ||
x86_64-macos-none \ | ||
x86_64-windows-gnu | ||
do | ||
if [[ $target == aarch64-macos-none ]]; then | ||
mcpu=apple_a14 | ||
else | ||
mcpu=baseline | ||
fi | ||
$ZIG build-exe -fno-emit-bin -target $target -mcpu=$mcpu "$zigfile" | ||
done | ||
|
||
|
||
# until hermetic_cc_toolchain gets a zig toolchain, run zig programs' unit tests here. | ||
echo "--- zig test $zigfile" | ||
$ZIG test "$zigfile" | ||
|
||
# as of 2023-10 yours truly (@motiejus) was not able to install wine64 | ||
# on CI. See the commit message for details. | ||
if [[ -z "${HERMETIC_CC_TOOLCHAIN_SKIP_WINE:-}" ]]; then | ||
echo "--- test $zigfile via wine64" | ||
$ZIG test \ | ||
-target x86_64-windows-gnu \ | ||
--test-cmd wine64-stable \ | ||
--test-cmd-bin \ | ||
"$zigfile" | ||
fi | ||
$ZIG test "$zigfile" | ||
done |
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