Skip to content

Commit

Permalink
update actions to maybe build artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
pfgithub committed Feb 3, 2025
1 parent 1ec063e commit 9374949
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 486 deletions.
71 changes: 61 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- master
- llvm19
- 014-dev
concurrency:
# Cancels pending runs when a PR gets updated.
group: ${{ github.head_ref || github.run_id }}-${{ github.actor }}
Expand All @@ -19,83 +20,133 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and Test
- name: Build
run: sh ci/x86_64-linux-debug.sh
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: x86_64-linux-debug
path: build-debug/stage3-debug/bin/zig
x86_64-linux-release:
timeout-minutes: 420
runs-on: [self-hosted, Linux, x86_64]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and Test
- name: Build
run: sh ci/x86_64-linux-release.sh
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: x86_64-linux-release
path: build-release/stage3-release/bin/zig
aarch64-linux-debug:
timeout-minutes: 480
runs-on: [self-hosted, Linux, aarch64]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and Test
- name: Build
run: sh ci/aarch64-linux-debug.sh
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: aarch64-linux-debug
path: build-debug/stage3-debug/bin/zig
aarch64-linux-release:
timeout-minutes: 480
runs-on: [self-hosted, Linux, aarch64]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and Test
- name: Build
run: sh ci/aarch64-linux-release.sh
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: aarch64-linux-release
path: build-release/stage3-release/bin/zig
x86_64-macos-release:
runs-on: "macos-13"
env:
ARCH: "x86_64"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and Test
- name: Build
run: ci/x86_64-macos-release.sh
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: x86_64-macos-release
path: build-release/stage3-release/bin/zig
aarch64-macos-debug:
runs-on: [self-hosted, macOS, aarch64]
env:
ARCH: "aarch64"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and Test
- name: Build
run: ci/aarch64-macos-debug.sh
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: aarch64-macos-debug
path: build-debug/stage3-debug/bin/zig
aarch64-macos-release:
runs-on: [self-hosted, macOS, aarch64]
env:
ARCH: "aarch64"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and Test
- name: Build
run: ci/aarch64-macos-release.sh
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: aarch64-macos-release
path: build-release/stage3-release/bin/zig
x86_64-windows-debug:
runs-on: [self-hosted, Windows, x86_64]
env:
ARCH: "x86_64"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and Test
- name: Build
run: ci/x86_64-windows-debug.ps1
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: x86_64-windows-debug
path: build-debug/stage3-debug/bin/zig.exe
x86_64-windows-release:
runs-on: [self-hosted, Windows, x86_64]
env:
ARCH: "x86_64"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and Test
- name: Build
run: ci/x86_64-windows-release.ps1
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: x86_64-windows-release
path: build-release/stage3-release/bin/zig.exe
aarch64-windows:
runs-on: [self-hosted, Windows, aarch64]
env:
ARCH: "aarch64"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and Test
- name: Build
run: ci/aarch64-windows.ps1
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: aarch64-windows
path: build-release/stage3-release/bin/zig.exe
54 changes: 0 additions & 54 deletions ci/aarch64-linux-debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ ZIG="$PREFIX/bin/zig"

export PATH="$HOME/local/bin:$PATH"

# Make the `zig version` number consistent.
# This will affect the cmake command below.
git fetch --unshallow || true
git fetch --tags

export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"

Expand Down Expand Up @@ -48,52 +43,3 @@ unset CC
unset CXX

ninja install

# simultaneously test building self-hosted without LLVM and with 32-bit arm
stage3-debug/bin/zig build \
-Dtarget=arm-linux-musleabihf \
-Dno-lib

# No -fqemu and -fwasmtime here as they're covered by the x86_64-linux scripts.
stage3-debug/bin/zig build test docs \
--maxrss 24696061952 \
-Dstatic-llvm \
-Dtarget=native-native-musl \
--search-prefix "$PREFIX" \
--zig-lib-dir "$PWD/../lib" \
-Denable-superhtml

# Ensure that updating the wasm binary from this commit will result in a viable build.
stage3-debug/bin/zig build update-zig1

rm -rf ../build-new
mkdir ../build-new
cd ../build-new

export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"

cmake .. \
-DCMAKE_PREFIX_PATH="$PREFIX" \
-DCMAKE_BUILD_TYPE=Debug \
-DZIG_TARGET_TRIPLE="$TARGET" \
-DZIG_TARGET_MCPU="$MCPU" \
-DZIG_STATIC=ON \
-DZIG_NO_LIB=ON \
-GNinja

unset CC
unset CXX

ninja install

stage3/bin/zig test ../test/behavior.zig
stage3/bin/zig build -p stage4 \
-Dstatic-llvm \
-Dtarget=native-native-musl \
-Dno-lib \
--search-prefix "$PREFIX" \
--zig-lib-dir "$PWD/../lib"
stage4/bin/zig test ../test/behavior.zig
70 changes: 0 additions & 70 deletions ci/aarch64-linux-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ ZIG="$PREFIX/bin/zig"

export PATH="$HOME/local/bin:$PATH"

# Make the `zig version` number consistent.
# This will affect the cmake command below.
git fetch --unshallow || true
git fetch --tags

export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"

Expand Down Expand Up @@ -48,68 +43,3 @@ unset CC
unset CXX

ninja install

# simultaneously test building self-hosted without LLVM and with 32-bit arm
stage3-release/bin/zig build \
-Dtarget=arm-linux-musleabihf \
-Dno-lib

# No -fqemu and -fwasmtime here as they're covered by the x86_64-linux scripts.
stage3-release/bin/zig build test docs \
--maxrss 24696061952 \
-Dstatic-llvm \
-Dtarget=native-native-musl \
--search-prefix "$PREFIX" \
--zig-lib-dir "$PWD/../lib" \
-Denable-superhtml

# Ensure that stage3 and stage4 are byte-for-byte identical.
stage3-release/bin/zig build \
--prefix stage4-release \
-Denable-llvm \
-Dno-lib \
-Doptimize=ReleaseFast \
-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

# Ensure that updating the wasm binary from this commit will result in a viable build.
stage3-release/bin/zig build update-zig1

rm -rf ../build-new
mkdir ../build-new
cd ../build-new

export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"

cmake .. \
-DCMAKE_PREFIX_PATH="$PREFIX" \
-DCMAKE_BUILD_TYPE=Release \
-DZIG_TARGET_TRIPLE="$TARGET" \
-DZIG_TARGET_MCPU="$MCPU" \
-DZIG_STATIC=ON \
-DZIG_NO_LIB=ON \
-GNinja

unset CC
unset CXX

ninja install

stage3/bin/zig test ../test/behavior.zig
stage3/bin/zig build -p stage4 \
-Dstatic-llvm \
-Dtarget=native-native-musl \
-Dno-lib \
--search-prefix "$PREFIX" \
--zig-lib-dir "$PWD/../lib"
stage4/bin/zig test ../test/behavior.zig
12 changes: 0 additions & 12 deletions ci/aarch64-macos-debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ fi

cd $ZIGDIR

# Make the `zig version` number consistent.
# This will affect the cmake command below.
git fetch --unshallow || true
git fetch --tags

rm -rf build-debug
mkdir build-debug
cd build-debug
Expand All @@ -49,10 +44,3 @@ PATH="$HOME/local/bin:$PATH" cmake .. \
-GNinja

$HOME/local/bin/ninja install

stage3-debug/bin/zig build test docs \
--zig-lib-dir "$PWD/../lib" \
-Denable-macos-sdk \
-Dstatic-llvm \
-Dskip-non-native \
--search-prefix "$PREFIX"
30 changes: 1 addition & 29 deletions ci/aarch64-macos-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ fi

cd $ZIGDIR

# Make the `zig version` number consistent.
# This will affect the cmake command below.
git fetch --unshallow || true
git fetch --tags

rm -rf build-release
mkdir build-release
cd build-release
Expand All @@ -48,27 +43,4 @@ PATH="$HOME/local/bin:$PATH" cmake .. \
-DZIG_NO_LIB=ON \
-GNinja

$HOME/local/bin/ninja install

stage3-release/bin/zig build test docs \
--zig-lib-dir "$PWD/../lib" \
-Denable-macos-sdk \
-Dstatic-llvm \
-Dskip-non-native \
--search-prefix "$PREFIX"

# Ensure that stage3 and stage4 are byte-for-byte identical.
stage3-release/bin/zig build \
--prefix stage4-release \
-Denable-llvm \
-Dno-lib \
-Doptimize=ReleaseFast \
-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
$HOME/local/bin/ninja install
Loading

0 comments on commit 9374949

Please sign in to comment.