authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-01-09 15:47:54-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-01-09 15:48:02-07:00
log8583e88db522f0f94f2110f1d255406e5e7e99fd
tree8c04379ff1e0ebedc5b41551b1b9349a3b913f02
parentda96e7efccba51ad3749636d32f82b4193a590b8

CI: update to github actions in the 0.10.x branch


8 files changed, 73 insertions(+), 100 deletions(-)

.github/workflows/ci.yaml+2-12
......@@ -1,9 +1,8 @@
11name: ci
22on:
3 pull_request:
43 push:
54 branches:
6 - master
5 - 0.10.x
76concurrency:
87 # Cancels pending runs when a PR gets updated.
98 group: ${{ github.head_ref || github.run_id }}-${{ github.actor }}
......@@ -39,22 +38,13 @@ jobs:
3938 run: sh ci/aarch64-linux-release.sh
4039 x86_64-macos:
4140 runs-on: "macos-11"
42 env:
41 env:
4342 ARCH: "x86_64"
4443 steps:
4544 - name: Checkout
4645 uses: actions/checkout@v3
4746 - name: Build and Test
4847 run: ci/x86_64-macos.sh
49 aarch64-macos:
50 runs-on: [self-hosted, macOS, aarch64]
51 env:
52 ARCH: "aarch64"
53 steps:
54 - name: Checkout
55 uses: actions/checkout@v3
56 - name: Build and Test
57 run: ci/aarch64-macos.sh
5848 x86_64-windows:
5949 runs-on: windows-latest
6050 env:
ci/aarch64-linux-debug.sh+2-4
......@@ -8,7 +8,7 @@ set -e
88ARCH="$(uname -m)"
99TARGET="$ARCH-linux-musl"
1010MCPU="baseline"
11CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.448+e6e459e9e"
11CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.971+19056cb68"
1212PREFIX="$HOME/deps/$CACHE_BASENAME"
1313ZIG="$PREFIX/bin/zig"
1414
......@@ -57,8 +57,6 @@ stage3-debug/bin/zig fmt --check .. \
5757# simultaneously test building self-hosted without LLVM and with 32-bit arm
5858stage3-debug/bin/zig build -Dtarget=arm-linux-musleabihf
5959
60# TODO: add -fqemu back to this line
61
6260stage3-debug/bin/zig build test docs \
6361 -fwasmtime \
6462 -Dstatic-llvm \
......@@ -67,7 +65,7 @@ stage3-debug/bin/zig build test docs \
6765 --zig-lib-dir "$(pwd)/../lib"
6866
6967# Look for HTML errors.
70tidy --drop-empty-elements no -qe ../zig-cache/langref.html
68tidy --drop-empty-elements no -qe "$ZIG_LOCAL_CACHE_DIR/langref.html"
7169
7270# Produce the experimental std lib documentation.
7371stage3-debug/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib
ci/aarch64-linux-release.sh+4-9
......@@ -8,9 +8,9 @@ set -e
88ARCH="$(uname -m)"
99TARGET="$ARCH-linux-musl"
1010MCPU="baseline"
11CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.448+e6e459e9e"
11CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.971+19056cb68"
1212PREFIX="$HOME/deps/$CACHE_BASENAME"
13ZIG="$PREFIX/bin/zig"
13ZIG="$PREFIX/bin/zig"
1414
1515export PATH="$HOME/deps/wasmtime-v2.0.2-$ARCH-linux:$PATH"
1616
......@@ -57,8 +57,6 @@ stage3-release/bin/zig fmt --check .. \
5757# simultaneously test building self-hosted without LLVM and with 32-bit arm
5858stage3-release/bin/zig build -Dtarget=arm-linux-musleabihf
5959
60# TODO: add -fqemu back to this line
61
6260stage3-release/bin/zig build test docs \
6361 -fwasmtime \
6462 -Dstatic-llvm \
......@@ -67,10 +65,7 @@ stage3-release/bin/zig build test docs \
6765 --zig-lib-dir "$(pwd)/../lib"
6866
6967# Look for HTML errors.
70tidy --drop-empty-elements no -qe ../zig-cache/langref.html
68tidy --drop-empty-elements no -qe "$ZIG_LOCAL_CACHE_DIR/langref.html"
7169
7270# Produce the experimental std lib documentation.
73stage3-release/bin/zig test ../lib/std/std.zig \
74 -femit-docs \
75 -fno-emit-bin \
76 --zig-lib-dir "$(pwd)/../lib"
71stage3-release/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib
ci/aarch64-macos.sh+19-7
......@@ -4,12 +4,12 @@ set -x
44set -e
55
66# Script assumes the presence of the following:
7# s3cmd
7# s3cmd
88
99ZIGDIR="$(pwd)"
1010TARGET="$ARCH-macos-none"
1111MCPU="baseline"
12CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.448+e6e459e9e"
12CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.534+b0b1cc356-1"
1313PREFIX="$HOME/$CACHE_BASENAME"
1414ZIG="$PREFIX/bin/zig"
1515
......@@ -51,8 +51,20 @@ stage3-release/bin/zig build test docs \
5151 --search-prefix "$PREFIX"
5252
5353# Produce the experimental std lib documentation.
54mkdir -p "stage3-release/doc/std"
55stage3-release/bin/zig test "$(pwd)/../lib/std/std.zig" \
56 --zig-lib-dir "$(pwd)/../lib" \
57 -femit-docs="$(pwd)/stage3-release/doc/std" \
58 -fno-emit-bin
54stage3-release/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib
55
56# Ensure that stage3 and stage4 are byte-for-byte identical.
57stage3-release/bin/zig build \
58 --prefix stage4-release \
59 -Denable-llvm \
60 -Dno-lib \
61 -Drelease \
62 -Dstrip \
63 -Dtarget=$TARGET \
64 -Duse-zig-libcxx \
65 -Dversion-string="$(stage3-release/bin/zig version)"
66
67# diff returns an error code if the files differ.
68echo "If the following command fails, it means nondeterminism has been"
69echo "introduced, making stage3 and stage4 no longer byte-for-byte identical."
70diff stage3-release/bin/zig stage4-release/bin/zig
ci/x86_64-linux-debug.sh+3-6
......@@ -8,7 +8,7 @@ set -e
88ARCH="$(uname -m)"
99TARGET="$ARCH-linux-musl"
1010MCPU="baseline"
11CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.448+e6e459e9e"
11CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.971+19056cb68"
1212PREFIX="$HOME/deps/$CACHE_BASENAME"
1313ZIG="$PREFIX/bin/zig"
1414
......@@ -66,10 +66,7 @@ stage3-debug/bin/zig build test docs \
6666 --zig-lib-dir "$(pwd)/../lib"
6767
6868# Look for HTML errors.
69tidy --drop-empty-elements no -qe ../zig-cache/langref.html
69tidy --drop-empty-elements no -qe "$ZIG_LOCAL_CACHE_DIR/langref.html"
7070
7171# Produce the experimental std lib documentation.
72stage3-debug/bin/zig test ../lib/std/std.zig \
73 -femit-docs \
74 -fno-emit-bin \
75 --zig-lib-dir "$(pwd)/../lib"
72stage3-debug/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib
ci/x86_64-linux-release.sh+4-23
......@@ -8,9 +8,9 @@ set -e
88ARCH="$(uname -m)"
99TARGET="$ARCH-linux-musl"
1010MCPU="baseline"
11CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.448+e6e459e9e"
11CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.971+19056cb68"
1212PREFIX="$HOME/deps/$CACHE_BASENAME"
13ZIG="$PREFIX/bin/zig"
13ZIG="$PREFIX/bin/zig"
1414
1515export PATH="$HOME/deps/wasmtime-v2.0.2-$ARCH-linux:$HOME/deps/qemu-linux-x86_64-6.1.0.1/bin:$PATH"
1616
......@@ -67,26 +67,7 @@ stage3-release/bin/zig build test docs \
6767 --zig-lib-dir "$(pwd)/../lib"
6868
6969# Look for HTML errors.
70tidy --drop-empty-elements no -qe ../zig-cache/langref.html
70tidy --drop-empty-elements no -qe "$ZIG_LOCAL_CACHE_DIR/langref.html"
7171
7272# Produce the experimental std lib documentation.
73stage3-release/bin/zig test ../lib/std/std.zig \
74 -femit-docs \
75 -fno-emit-bin \
76 --zig-lib-dir "$(pwd)/../lib"
77
78stage3-release/bin/zig build \
79 --prefix stage4-release \
80 -Denable-llvm \
81 -Denable-stage1 \
82 -Dno-lib \
83 -Drelease \
84 -Dstrip \
85 -Dtarget=$TARGET \
86 -Duse-zig-libcxx \
87 -Dversion-string="$(stage3-release/bin/zig version)"
88
89# diff returns an error code if the files differ.
90echo "If the following command fails, it means nondeterminism has been"
91echo "introduced, making stage3 and stage4 no longer byte-for-byte identical."
92diff stage3-release/bin/zig stage4-release/bin/zig
73stage3-release/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib
ci/x86_64-macos.sh+3-7
......@@ -4,12 +4,12 @@ set -x
44set -e
55
66# Script assumes the presence of the following:
7# s3cmd
7# s3cmd
88
99ZIGDIR="$(pwd)"
1010TARGET="$ARCH-macos-none"
1111MCPU="baseline"
12CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.448+e6e459e9e"
12CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.534+b0b1cc356"
1313PREFIX="$HOME/$CACHE_BASENAME"
1414JOBS="-j3"
1515
......@@ -59,8 +59,4 @@ stage3-release/bin/zig build test docs \
5959 --search-prefix "$PREFIX"
6060
6161# Produce the experimental std lib documentation.
62mkdir -p "stage3-release/doc/std"
63stage3-release/bin/zig test "$(pwd)/../lib/std/std.zig" \
64 --zig-lib-dir "$(pwd)/../lib" \
65 -femit-docs="$(pwd)/stage3-release/doc/std" \
66 -fno-emit-bin
62stage3-release/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib
ci/x86_64-windows.ps1+36-32
......@@ -1,20 +1,18 @@
11$TARGET = "$($Env:ARCH)-windows-gnu"
22$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.11.0-dev.448+e6e459e9e"
3$MCPU = "baseline"
34$ZIG_LLVM_CLANG_LLD_URL = "https://ziglang.org/deps/$ZIG_LLVM_CLANG_LLD_NAME.zip"
5$PREFIX_PATH = "$(Get-Location)\$ZIG_LLVM_CLANG_LLD_NAME"
6$ZIG = "$PREFIX_PATH\bin\zig.exe"
7$ZIG_LIB_DIR = "$(Get-Location)\lib"
48
59Write-Output "Downloading $ZIG_LLVM_CLANG_LLD_URL"
6
710Invoke-WebRequest -Uri "$ZIG_LLVM_CLANG_LLD_URL" -OutFile "$ZIG_LLVM_CLANG_LLD_NAME.zip"
811
912Write-Output "Extracting..."
10
11Add-Type -AssemblyName System.IO.Compression.FileSystem ;
13Add-Type -AssemblyName System.IO.Compression.FileSystem ;
1214[System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD/$ZIG_LLVM_CLANG_LLD_NAME.zip", "$PWD")
1315
14Set-Variable -Name ZIGLIBDIR -Value "$(Get-Location)\lib"
15Set-Variable -Name ZIGINSTALLDIR -Value "$(Get-Location)\stage3-release"
16Set-Variable -Name ZIGPREFIXPATH -Value "$(Get-Location)\$ZIG_LLVM_CLANG_LLD_NAME"
17
1816function CheckLastExitCode {
1917 if (!$?) {
2018 exit 1
......@@ -31,35 +29,41 @@ if ((git rev-parse --is-shallow-repository) -eq "true") {
3129 git fetch --unshallow # `git describe` won't work on a shallow repo
3230}
3331
34Write-Output "Building Zig..."
32Write-Output "Building from source..."
33Remove-Item -Path 'build-release' -Recurse -Force -ErrorAction Ignore
34New-Item -Path 'build-release' -ItemType Directory
35Set-Location -Path 'build-release'
3536
36& "$ZIGPREFIXPATH\bin\zig.exe" build `
37 --prefix "$ZIGINSTALLDIR" `
38 --search-prefix "$ZIGPREFIXPATH" `
39 --zig-lib-dir "$ZIGLIBDIR" `
40 -Denable-stage1 `
41 -Dstatic-llvm `
42 -Drelease `
43 -Duse-zig-libcxx `
44 -Dtarget="$TARGET"
37# CMake gives a syntax error when file paths with backward slashes are used.
38# Here, we use forward slashes only to work around this.
39& cmake .. `
40 -GNinja `
41 -DCMAKE_INSTALL_PREFIX="stage3-release" `
42 -DCMAKE_PREFIX_PATH="$($PREFIX_PATH -Replace "\\", "/")" `
43 -DCMAKE_BUILD_TYPE=Release `
44 -DCMAKE_C_COMPILER="$($ZIG -Replace "\\", "/");cc;-target;$TARGET;-mcpu=$MCPU" `
45 -DCMAKE_CXX_COMPILER="$($ZIG -Replace "\\", "/");c++;-target;$TARGET;-mcpu=$MCPU" `
46 -DZIG_TARGET_TRIPLE="$TARGET" `
47 -DZIG_TARGET_MCPU="$MCPU" `
48 -DZIG_STATIC=ON
4549CheckLastExitCode
4650
47Write-Output " zig build test docs..."
48
49& "$ZIGINSTALLDIR\bin\zig.exe" build test docs `
50 --search-prefix "$ZIGPREFIXPATH" `
51 -Dstatic-llvm `
52 -Dskip-non-native `
53 -Denable-symlinks-windows
51ninja install
5452CheckLastExitCode
5553
56# Produce the experimental std lib documentation.
57mkdir "$ZIGINSTALLDIR\doc\std" -force
58
59Write-Output "zig test std/std.zig..."
54Write-Output "Main test suite..."
55& "stage3-release\bin\zig.exe" build test docs `
56 --zig-lib-dir "$ZIG_LIB_DIR" `
57 --search-prefix "$PREFIX_PATH" `
58 -Dstatic-llvm `
59 -Dskip-non-native `
60 -Denable-symlinks-windows
61CheckLastExitCode
6062
61& "$ZIGINSTALLDIR\bin\zig.exe" test "$ZIGLIBDIR\std\std.zig" `
62 --zig-lib-dir "$ZIGLIBDIR" `
63 -femit-docs="$ZIGINSTALLDIR\doc\std" `
64 -fno-emit-bin
63Write-Output "Testing Autodocs..."
64& "stage3-release\bin\zig.exe" test "..\lib\std\std.zig" `
65 --zig-lib-dir "$ZIG_LIB_DIR" `
66 -femit-docs `
67 -fno-emit-bin
6568CheckLastExitCode
69