mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
CI: update to github actions in the 0.10.x branch
This commit is contained in:
parent
da96e7efcc
commit
8583e88db5
14
.github/workflows/ci.yaml
vendored
14
.github/workflows/ci.yaml
vendored
@ -1,9 +1,8 @@
|
|||||||
name: ci
|
name: ci
|
||||||
on:
|
on:
|
||||||
pull_request:
|
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- 0.10.x
|
||||||
concurrency:
|
concurrency:
|
||||||
# Cancels pending runs when a PR gets updated.
|
# Cancels pending runs when a PR gets updated.
|
||||||
group: ${{ github.head_ref || github.run_id }}-${{ github.actor }}
|
group: ${{ github.head_ref || github.run_id }}-${{ github.actor }}
|
||||||
@ -39,22 +38,13 @@ jobs:
|
|||||||
run: sh ci/aarch64-linux-release.sh
|
run: sh ci/aarch64-linux-release.sh
|
||||||
x86_64-macos:
|
x86_64-macos:
|
||||||
runs-on: "macos-11"
|
runs-on: "macos-11"
|
||||||
env:
|
env:
|
||||||
ARCH: "x86_64"
|
ARCH: "x86_64"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Build and Test
|
- name: Build and Test
|
||||||
run: ci/x86_64-macos.sh
|
run: ci/x86_64-macos.sh
|
||||||
aarch64-macos:
|
|
||||||
runs-on: [self-hosted, macOS, aarch64]
|
|
||||||
env:
|
|
||||||
ARCH: "aarch64"
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: Build and Test
|
|
||||||
run: ci/aarch64-macos.sh
|
|
||||||
x86_64-windows:
|
x86_64-windows:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
env:
|
env:
|
||||||
|
|||||||
@ -8,7 +8,7 @@ set -e
|
|||||||
ARCH="$(uname -m)"
|
ARCH="$(uname -m)"
|
||||||
TARGET="$ARCH-linux-musl"
|
TARGET="$ARCH-linux-musl"
|
||||||
MCPU="baseline"
|
MCPU="baseline"
|
||||||
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.448+e6e459e9e"
|
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.971+19056cb68"
|
||||||
PREFIX="$HOME/deps/$CACHE_BASENAME"
|
PREFIX="$HOME/deps/$CACHE_BASENAME"
|
||||||
ZIG="$PREFIX/bin/zig"
|
ZIG="$PREFIX/bin/zig"
|
||||||
|
|
||||||
@ -57,8 +57,6 @@ stage3-debug/bin/zig fmt --check .. \
|
|||||||
# simultaneously test building self-hosted without LLVM and with 32-bit arm
|
# simultaneously test building self-hosted without LLVM and with 32-bit arm
|
||||||
stage3-debug/bin/zig build -Dtarget=arm-linux-musleabihf
|
stage3-debug/bin/zig build -Dtarget=arm-linux-musleabihf
|
||||||
|
|
||||||
# TODO: add -fqemu back to this line
|
|
||||||
|
|
||||||
stage3-debug/bin/zig build test docs \
|
stage3-debug/bin/zig build test docs \
|
||||||
-fwasmtime \
|
-fwasmtime \
|
||||||
-Dstatic-llvm \
|
-Dstatic-llvm \
|
||||||
@ -67,7 +65,7 @@ stage3-debug/bin/zig build test docs \
|
|||||||
--zig-lib-dir "$(pwd)/../lib"
|
--zig-lib-dir "$(pwd)/../lib"
|
||||||
|
|
||||||
# Look for HTML errors.
|
# Look for HTML errors.
|
||||||
tidy --drop-empty-elements no -qe ../zig-cache/langref.html
|
tidy --drop-empty-elements no -qe "$ZIG_LOCAL_CACHE_DIR/langref.html"
|
||||||
|
|
||||||
# Produce the experimental std lib documentation.
|
# Produce the experimental std lib documentation.
|
||||||
stage3-debug/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib
|
stage3-debug/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib
|
||||||
|
|||||||
@ -8,9 +8,9 @@ set -e
|
|||||||
ARCH="$(uname -m)"
|
ARCH="$(uname -m)"
|
||||||
TARGET="$ARCH-linux-musl"
|
TARGET="$ARCH-linux-musl"
|
||||||
MCPU="baseline"
|
MCPU="baseline"
|
||||||
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.448+e6e459e9e"
|
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.971+19056cb68"
|
||||||
PREFIX="$HOME/deps/$CACHE_BASENAME"
|
PREFIX="$HOME/deps/$CACHE_BASENAME"
|
||||||
ZIG="$PREFIX/bin/zig"
|
ZIG="$PREFIX/bin/zig"
|
||||||
|
|
||||||
export PATH="$HOME/deps/wasmtime-v2.0.2-$ARCH-linux:$PATH"
|
export PATH="$HOME/deps/wasmtime-v2.0.2-$ARCH-linux:$PATH"
|
||||||
|
|
||||||
@ -57,8 +57,6 @@ stage3-release/bin/zig fmt --check .. \
|
|||||||
# simultaneously test building self-hosted without LLVM and with 32-bit arm
|
# simultaneously test building self-hosted without LLVM and with 32-bit arm
|
||||||
stage3-release/bin/zig build -Dtarget=arm-linux-musleabihf
|
stage3-release/bin/zig build -Dtarget=arm-linux-musleabihf
|
||||||
|
|
||||||
# TODO: add -fqemu back to this line
|
|
||||||
|
|
||||||
stage3-release/bin/zig build test docs \
|
stage3-release/bin/zig build test docs \
|
||||||
-fwasmtime \
|
-fwasmtime \
|
||||||
-Dstatic-llvm \
|
-Dstatic-llvm \
|
||||||
@ -67,10 +65,7 @@ stage3-release/bin/zig build test docs \
|
|||||||
--zig-lib-dir "$(pwd)/../lib"
|
--zig-lib-dir "$(pwd)/../lib"
|
||||||
|
|
||||||
# Look for HTML errors.
|
# Look for HTML errors.
|
||||||
tidy --drop-empty-elements no -qe ../zig-cache/langref.html
|
tidy --drop-empty-elements no -qe "$ZIG_LOCAL_CACHE_DIR/langref.html"
|
||||||
|
|
||||||
# Produce the experimental std lib documentation.
|
# Produce the experimental std lib documentation.
|
||||||
stage3-release/bin/zig test ../lib/std/std.zig \
|
stage3-release/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib
|
||||||
-femit-docs \
|
|
||||||
-fno-emit-bin \
|
|
||||||
--zig-lib-dir "$(pwd)/../lib"
|
|
||||||
|
|||||||
@ -4,12 +4,12 @@ set -x
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Script assumes the presence of the following:
|
# Script assumes the presence of the following:
|
||||||
# s3cmd
|
# s3cmd
|
||||||
|
|
||||||
ZIGDIR="$(pwd)"
|
ZIGDIR="$(pwd)"
|
||||||
TARGET="$ARCH-macos-none"
|
TARGET="$ARCH-macos-none"
|
||||||
MCPU="baseline"
|
MCPU="baseline"
|
||||||
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.448+e6e459e9e"
|
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.534+b0b1cc356-1"
|
||||||
PREFIX="$HOME/$CACHE_BASENAME"
|
PREFIX="$HOME/$CACHE_BASENAME"
|
||||||
ZIG="$PREFIX/bin/zig"
|
ZIG="$PREFIX/bin/zig"
|
||||||
|
|
||||||
@ -51,8 +51,20 @@ stage3-release/bin/zig build test docs \
|
|||||||
--search-prefix "$PREFIX"
|
--search-prefix "$PREFIX"
|
||||||
|
|
||||||
# Produce the experimental std lib documentation.
|
# Produce the experimental std lib documentation.
|
||||||
mkdir -p "stage3-release/doc/std"
|
stage3-release/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib
|
||||||
stage3-release/bin/zig test "$(pwd)/../lib/std/std.zig" \
|
|
||||||
--zig-lib-dir "$(pwd)/../lib" \
|
# Ensure that stage3 and stage4 are byte-for-byte identical.
|
||||||
-femit-docs="$(pwd)/stage3-release/doc/std" \
|
stage3-release/bin/zig build \
|
||||||
-fno-emit-bin
|
--prefix stage4-release \
|
||||||
|
-Denable-llvm \
|
||||||
|
-Dno-lib \
|
||||||
|
-Drelease \
|
||||||
|
-Dstrip \
|
||||||
|
-Dtarget=$TARGET \
|
||||||
|
-Duse-zig-libcxx \
|
||||||
|
-Dversion-string="$(stage3-release/bin/zig version)"
|
||||||
|
|
||||||
|
# diff returns an error code if the files differ.
|
||||||
|
echo "If the following command fails, it means nondeterminism has been"
|
||||||
|
echo "introduced, making stage3 and stage4 no longer byte-for-byte identical."
|
||||||
|
diff stage3-release/bin/zig stage4-release/bin/zig
|
||||||
|
|||||||
@ -8,7 +8,7 @@ set -e
|
|||||||
ARCH="$(uname -m)"
|
ARCH="$(uname -m)"
|
||||||
TARGET="$ARCH-linux-musl"
|
TARGET="$ARCH-linux-musl"
|
||||||
MCPU="baseline"
|
MCPU="baseline"
|
||||||
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.448+e6e459e9e"
|
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.971+19056cb68"
|
||||||
PREFIX="$HOME/deps/$CACHE_BASENAME"
|
PREFIX="$HOME/deps/$CACHE_BASENAME"
|
||||||
ZIG="$PREFIX/bin/zig"
|
ZIG="$PREFIX/bin/zig"
|
||||||
|
|
||||||
@ -66,10 +66,7 @@ stage3-debug/bin/zig build test docs \
|
|||||||
--zig-lib-dir "$(pwd)/../lib"
|
--zig-lib-dir "$(pwd)/../lib"
|
||||||
|
|
||||||
# Look for HTML errors.
|
# Look for HTML errors.
|
||||||
tidy --drop-empty-elements no -qe ../zig-cache/langref.html
|
tidy --drop-empty-elements no -qe "$ZIG_LOCAL_CACHE_DIR/langref.html"
|
||||||
|
|
||||||
# Produce the experimental std lib documentation.
|
# Produce the experimental std lib documentation.
|
||||||
stage3-debug/bin/zig test ../lib/std/std.zig \
|
stage3-debug/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib
|
||||||
-femit-docs \
|
|
||||||
-fno-emit-bin \
|
|
||||||
--zig-lib-dir "$(pwd)/../lib"
|
|
||||||
|
|||||||
@ -8,9 +8,9 @@ set -e
|
|||||||
ARCH="$(uname -m)"
|
ARCH="$(uname -m)"
|
||||||
TARGET="$ARCH-linux-musl"
|
TARGET="$ARCH-linux-musl"
|
||||||
MCPU="baseline"
|
MCPU="baseline"
|
||||||
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.448+e6e459e9e"
|
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.971+19056cb68"
|
||||||
PREFIX="$HOME/deps/$CACHE_BASENAME"
|
PREFIX="$HOME/deps/$CACHE_BASENAME"
|
||||||
ZIG="$PREFIX/bin/zig"
|
ZIG="$PREFIX/bin/zig"
|
||||||
|
|
||||||
export PATH="$HOME/deps/wasmtime-v2.0.2-$ARCH-linux:$HOME/deps/qemu-linux-x86_64-6.1.0.1/bin:$PATH"
|
export PATH="$HOME/deps/wasmtime-v2.0.2-$ARCH-linux:$HOME/deps/qemu-linux-x86_64-6.1.0.1/bin:$PATH"
|
||||||
|
|
||||||
@ -67,26 +67,7 @@ stage3-release/bin/zig build test docs \
|
|||||||
--zig-lib-dir "$(pwd)/../lib"
|
--zig-lib-dir "$(pwd)/../lib"
|
||||||
|
|
||||||
# Look for HTML errors.
|
# Look for HTML errors.
|
||||||
tidy --drop-empty-elements no -qe ../zig-cache/langref.html
|
tidy --drop-empty-elements no -qe "$ZIG_LOCAL_CACHE_DIR/langref.html"
|
||||||
|
|
||||||
# Produce the experimental std lib documentation.
|
# Produce the experimental std lib documentation.
|
||||||
stage3-release/bin/zig test ../lib/std/std.zig \
|
stage3-release/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib
|
||||||
-femit-docs \
|
|
||||||
-fno-emit-bin \
|
|
||||||
--zig-lib-dir "$(pwd)/../lib"
|
|
||||||
|
|
||||||
stage3-release/bin/zig build \
|
|
||||||
--prefix stage4-release \
|
|
||||||
-Denable-llvm \
|
|
||||||
-Denable-stage1 \
|
|
||||||
-Dno-lib \
|
|
||||||
-Drelease \
|
|
||||||
-Dstrip \
|
|
||||||
-Dtarget=$TARGET \
|
|
||||||
-Duse-zig-libcxx \
|
|
||||||
-Dversion-string="$(stage3-release/bin/zig version)"
|
|
||||||
|
|
||||||
# diff returns an error code if the files differ.
|
|
||||||
echo "If the following command fails, it means nondeterminism has been"
|
|
||||||
echo "introduced, making stage3 and stage4 no longer byte-for-byte identical."
|
|
||||||
diff stage3-release/bin/zig stage4-release/bin/zig
|
|
||||||
|
|||||||
@ -4,12 +4,12 @@ set -x
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Script assumes the presence of the following:
|
# Script assumes the presence of the following:
|
||||||
# s3cmd
|
# s3cmd
|
||||||
|
|
||||||
ZIGDIR="$(pwd)"
|
ZIGDIR="$(pwd)"
|
||||||
TARGET="$ARCH-macos-none"
|
TARGET="$ARCH-macos-none"
|
||||||
MCPU="baseline"
|
MCPU="baseline"
|
||||||
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.448+e6e459e9e"
|
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.534+b0b1cc356"
|
||||||
PREFIX="$HOME/$CACHE_BASENAME"
|
PREFIX="$HOME/$CACHE_BASENAME"
|
||||||
JOBS="-j3"
|
JOBS="-j3"
|
||||||
|
|
||||||
@ -59,8 +59,4 @@ stage3-release/bin/zig build test docs \
|
|||||||
--search-prefix "$PREFIX"
|
--search-prefix "$PREFIX"
|
||||||
|
|
||||||
# Produce the experimental std lib documentation.
|
# Produce the experimental std lib documentation.
|
||||||
mkdir -p "stage3-release/doc/std"
|
stage3-release/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib
|
||||||
stage3-release/bin/zig test "$(pwd)/../lib/std/std.zig" \
|
|
||||||
--zig-lib-dir "$(pwd)/../lib" \
|
|
||||||
-femit-docs="$(pwd)/stage3-release/doc/std" \
|
|
||||||
-fno-emit-bin
|
|
||||||
|
|||||||
@ -1,20 +1,18 @@
|
|||||||
$TARGET = "$($Env:ARCH)-windows-gnu"
|
$TARGET = "$($Env:ARCH)-windows-gnu"
|
||||||
$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.11.0-dev.448+e6e459e9e"
|
$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.11.0-dev.448+e6e459e9e"
|
||||||
|
$MCPU = "baseline"
|
||||||
$ZIG_LLVM_CLANG_LLD_URL = "https://ziglang.org/deps/$ZIG_LLVM_CLANG_LLD_NAME.zip"
|
$ZIG_LLVM_CLANG_LLD_URL = "https://ziglang.org/deps/$ZIG_LLVM_CLANG_LLD_NAME.zip"
|
||||||
|
$PREFIX_PATH = "$(Get-Location)\$ZIG_LLVM_CLANG_LLD_NAME"
|
||||||
|
$ZIG = "$PREFIX_PATH\bin\zig.exe"
|
||||||
|
$ZIG_LIB_DIR = "$(Get-Location)\lib"
|
||||||
|
|
||||||
Write-Output "Downloading $ZIG_LLVM_CLANG_LLD_URL"
|
Write-Output "Downloading $ZIG_LLVM_CLANG_LLD_URL"
|
||||||
|
|
||||||
Invoke-WebRequest -Uri "$ZIG_LLVM_CLANG_LLD_URL" -OutFile "$ZIG_LLVM_CLANG_LLD_NAME.zip"
|
Invoke-WebRequest -Uri "$ZIG_LLVM_CLANG_LLD_URL" -OutFile "$ZIG_LLVM_CLANG_LLD_NAME.zip"
|
||||||
|
|
||||||
Write-Output "Extracting..."
|
Write-Output "Extracting..."
|
||||||
|
Add-Type -AssemblyName System.IO.Compression.FileSystem ;
|
||||||
Add-Type -AssemblyName System.IO.Compression.FileSystem ;
|
|
||||||
[System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD/$ZIG_LLVM_CLANG_LLD_NAME.zip", "$PWD")
|
[System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD/$ZIG_LLVM_CLANG_LLD_NAME.zip", "$PWD")
|
||||||
|
|
||||||
Set-Variable -Name ZIGLIBDIR -Value "$(Get-Location)\lib"
|
|
||||||
Set-Variable -Name ZIGINSTALLDIR -Value "$(Get-Location)\stage3-release"
|
|
||||||
Set-Variable -Name ZIGPREFIXPATH -Value "$(Get-Location)\$ZIG_LLVM_CLANG_LLD_NAME"
|
|
||||||
|
|
||||||
function CheckLastExitCode {
|
function CheckLastExitCode {
|
||||||
if (!$?) {
|
if (!$?) {
|
||||||
exit 1
|
exit 1
|
||||||
@ -31,35 +29,41 @@ if ((git rev-parse --is-shallow-repository) -eq "true") {
|
|||||||
git fetch --unshallow # `git describe` won't work on a shallow repo
|
git fetch --unshallow # `git describe` won't work on a shallow repo
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Output "Building Zig..."
|
Write-Output "Building from source..."
|
||||||
|
Remove-Item -Path 'build-release' -Recurse -Force -ErrorAction Ignore
|
||||||
|
New-Item -Path 'build-release' -ItemType Directory
|
||||||
|
Set-Location -Path 'build-release'
|
||||||
|
|
||||||
& "$ZIGPREFIXPATH\bin\zig.exe" build `
|
# CMake gives a syntax error when file paths with backward slashes are used.
|
||||||
--prefix "$ZIGINSTALLDIR" `
|
# Here, we use forward slashes only to work around this.
|
||||||
--search-prefix "$ZIGPREFIXPATH" `
|
& cmake .. `
|
||||||
--zig-lib-dir "$ZIGLIBDIR" `
|
-GNinja `
|
||||||
-Denable-stage1 `
|
-DCMAKE_INSTALL_PREFIX="stage3-release" `
|
||||||
-Dstatic-llvm `
|
-DCMAKE_PREFIX_PATH="$($PREFIX_PATH -Replace "\\", "/")" `
|
||||||
-Drelease `
|
-DCMAKE_BUILD_TYPE=Release `
|
||||||
-Duse-zig-libcxx `
|
-DCMAKE_C_COMPILER="$($ZIG -Replace "\\", "/");cc;-target;$TARGET;-mcpu=$MCPU" `
|
||||||
-Dtarget="$TARGET"
|
-DCMAKE_CXX_COMPILER="$($ZIG -Replace "\\", "/");c++;-target;$TARGET;-mcpu=$MCPU" `
|
||||||
|
-DZIG_TARGET_TRIPLE="$TARGET" `
|
||||||
|
-DZIG_TARGET_MCPU="$MCPU" `
|
||||||
|
-DZIG_STATIC=ON
|
||||||
CheckLastExitCode
|
CheckLastExitCode
|
||||||
|
|
||||||
Write-Output " zig build test docs..."
|
ninja install
|
||||||
|
|
||||||
& "$ZIGINSTALLDIR\bin\zig.exe" build test docs `
|
|
||||||
--search-prefix "$ZIGPREFIXPATH" `
|
|
||||||
-Dstatic-llvm `
|
|
||||||
-Dskip-non-native `
|
|
||||||
-Denable-symlinks-windows
|
|
||||||
CheckLastExitCode
|
CheckLastExitCode
|
||||||
|
|
||||||
# Produce the experimental std lib documentation.
|
Write-Output "Main test suite..."
|
||||||
mkdir "$ZIGINSTALLDIR\doc\std" -force
|
& "stage3-release\bin\zig.exe" build test docs `
|
||||||
|
--zig-lib-dir "$ZIG_LIB_DIR" `
|
||||||
Write-Output "zig test std/std.zig..."
|
--search-prefix "$PREFIX_PATH" `
|
||||||
|
-Dstatic-llvm `
|
||||||
& "$ZIGINSTALLDIR\bin\zig.exe" test "$ZIGLIBDIR\std\std.zig" `
|
-Dskip-non-native `
|
||||||
--zig-lib-dir "$ZIGLIBDIR" `
|
-Denable-symlinks-windows
|
||||||
-femit-docs="$ZIGINSTALLDIR\doc\std" `
|
|
||||||
-fno-emit-bin
|
|
||||||
CheckLastExitCode
|
CheckLastExitCode
|
||||||
|
|
||||||
|
Write-Output "Testing Autodocs..."
|
||||||
|
& "stage3-release\bin\zig.exe" test "..\lib\std\std.zig" `
|
||||||
|
--zig-lib-dir "$ZIG_LIB_DIR" `
|
||||||
|
-femit-docs `
|
||||||
|
-fno-emit-bin
|
||||||
|
CheckLastExitCode
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user