-
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.
Merge pull request #156 from motiejus/macos-sdk
CI and MacOS fixes
- Loading branch information
Showing
21 changed files
with
177 additions
and
157 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 |
---|---|---|
@@ -1 +1 @@ | ||
7.0.0 | ||
7.0.2 |
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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/sh | ||
set -x | ||
set -ex | ||
|
||
git config --global user.email "buildkite@example.com" | ||
git config --global user.name "Buildkite Bot" | ||
git config --global user.email "ci@example.com" | ||
git config --global user.name "CI Bot" |
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 |
---|---|---|
@@ -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
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 |
---|---|---|
|
@@ -49,6 +49,7 @@ _attrs = { | |
"_cp": attr.label( | ||
default = "//rules:cp", | ||
allow_single_file = True, | ||
cfg = "exec", | ||
), | ||
} | ||
|
||
|
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
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.