authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-11-28 15:12:31-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-12-10 16:28:49-07:00
logc9231f05470a1abc600010c72a535de883731da6
treeb53da3a0904de7f930a3c15f38f3f2b3ffa0dfe6
parent74718a11831ea82b20bfe4e2f9211ccf322ead33

CI: add aarch64-windows coverage


2 files changed, 85 insertions(+), 2 deletions(-)

.github/workflows/ci.yaml+11-2
......@@ -39,7 +39,7 @@ jobs:
3939 run: sh ci/aarch64-linux-release.sh
4040 x86_64-macos:
4141 runs-on: "macos-11"
42 env:
42 env:
4343 ARCH: "x86_64"
4444 steps:
4545 - name: Checkout
......@@ -48,7 +48,7 @@ jobs:
4848 run: ci/x86_64-macos.sh
4949 aarch64-macos:
5050 runs-on: [self-hosted, macOS, aarch64]
51 env:
51 env:
5252 ARCH: "aarch64"
5353 steps:
5454 - name: Checkout
......@@ -64,3 +64,12 @@ jobs:
6464 uses: actions/checkout@v3
6565 - name: Build and Test
6666 run: ci/x86_64-windows.ps1
67 aarch64-windows:
68 runs-on: [self-hosted, Windows, aarch64]
69 env:
70 ARCH: "aarch64"
71 steps:
72 - name: Checkout
73 uses: actions/checkout@v3
74 - name: Build and Test
75 run: ci/aarch64-windows.ps1
ci/aarch64-windows.ps1 created+74
......@@ -0,0 +1,74 @@
1$TARGET = "$($Env:ARCH)-windows-gnu"
2$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.11.0-dev.670+f7fea080b"
3$MCPU = "baseline"
4$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"
8
9if (!(Test-Path "..\$ZIG_LLVM_CLANG_LLD_NAME.zip")) {
10 Write-Output "Downloading $ZIG_LLVM_CLANG_LLD_URL"
11 Invoke-WebRequest -Uri "$ZIG_LLVM_CLANG_LLD_URL" -OutFile "..\$ZIG_LLVM_CLANG_LLD_NAME.zip"
12
13 Write-Output "Extracting..."
14 Add-Type -AssemblyName System.IO.Compression.FileSystem ;
15 [System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD\..\$ZIG_LLVM_CLANG_LLD_NAME.zip", "$PWD\..")
16}
17
18function CheckLastExitCode {
19 if (!$?) {
20 exit 1
21 }
22 return 0
23}
24
25# Make the `zig version` number consistent.
26# This will affect the `zig build` command below which uses `git describe`.
27git config core.abbrev 9
28git fetch --tags
29
30if ((git rev-parse --is-shallow-repository) -eq "true") {
31 git fetch --unshallow # `git describe` won't work on a shallow repo
32}
33
34Write-Output "Building from source..."
35Remove-Item -Path 'build-release' -Recurse -Force -ErrorAction Ignore
36New-Item -Path 'build-release' -ItemType Directory
37Set-Location -Path 'build-release'
38
39# CMake gives a syntax error when file paths with backward slashes are used.
40# Here, we use forward slashes only to work around this.
41& cmake .. `
42 -GNinja `
43 -DCMAKE_INSTALL_PREFIX="stage3-release" `
44 -DCMAKE_PREFIX_PATH="$($PREFIX_PATH -Replace "\\", "/")" `
45 -DCMAKE_BUILD_TYPE=Release `
46 -DCMAKE_C_COMPILER="$($ZIG -Replace "\\", "/");cc;-target;$TARGET;-mcpu=$MCPU" `
47 -DCMAKE_CXX_COMPILER="$($ZIG -Replace "\\", "/");c++;-target;$TARGET;-mcpu=$MCPU" `
48 -DCMAKE_AR="$ZIG" `
49 -DCMAKE_C_ARCHIVE_CREATE="<CMAKE_AR> ar qc <TARGET> <LINK_FLAGS> <OBJECTS>" `
50 -DCMAKE_CXX_ARCHIVE_CREATE="<CMAKE_AR> ar qc <TARGET> <LINK_FLAGS> <OBJECTS>" `
51 -DZIG_TARGET_TRIPLE="$TARGET" `
52 -DZIG_TARGET_MCPU="$MCPU" `
53 -DZIG_STATIC=ON
54CheckLastExitCode
55
56ninja install
57CheckLastExitCode
58
59Write-Output "Main test suite..."
60& "stage3-release\bin\zig.exe" build test docs `
61 --zig-lib-dir "$ZIG_LIB_DIR" `
62 --search-prefix "$PREFIX_PATH" `
63 -Dstatic-llvm `
64 -Dskip-non-native `
65 -Denable-symlinks-windows
66CheckLastExitCode
67
68Write-Output "Testing Autodocs..."
69& "stage3-release\bin\zig.exe" test "..\lib\std\std.zig" `
70 --zig-lib-dir "$ZIG_LIB_DIR" `
71 -femit-docs `
72 -fno-emit-bin
73CheckLastExitCode
74