Skip to content

Commit

Permalink
Add Zig to CI for ubuntu-rolling
Browse files Browse the repository at this point in the history
  • Loading branch information
RossComputerGuy committed Aug 6, 2024
1 parent 97f06ca commit 53f388c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/os_comp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ jobs:
MESON_ARGS: '--unity=on'
CC: 'gcc'
CXX: 'g++'
- CC: 'zig cc'
CXX: 'zig c++'

env:
MESON_CI_JOBNAME_UPDATE: linux-${{ github.job }}-${{ matrix.cfg.CC }}
Expand Down
15 changes: 15 additions & 0 deletions ci/ciimage/ubuntu-rolling/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pkgs=(
bindgen
itstool
openjdk-11-jre
jq
)

sed -i '/^Types: deb/s/deb/deb deb-src/' /etc/apt/sources.list.d/ubuntu.sources
Expand All @@ -50,6 +51,20 @@ dub_fetch dubtestproject
dub build dubtestproject:test1 --compiler=ldc2
dub build dubtestproject:test2 --compiler=ldc2

# zig

ZIG_DOWNLOAD_INDEX=$(wget -qO- https://ziglang.org/download/index.json)
ZIG_VERSION=$(echo "$ZIG_DOWNLOAD_INDEX" | jq -r ". | keys_unsorted | .[1]")
ZIG_ARCHIVE=$(echo "$ZIG_DOWNLOAD_INDEX" | jq -r ".[\"$ZIG_VERSION\"][\"$(uname -m)-linux\"].tarball")
ZIG_DIR=$(basename "$ZIG_ARCHIVE" | sed 's/.tar.xz//')
wget -O zig.tar.xz "$ZIG_ARCHIVE"

tar xf zig.tar.xz
rm zig.tar.xz

mv "$ZIG_DIR" /opt/zig
ln -s /opt/zig/zig /usr/bin/zig

# Remove debian version of Rust and install latest with rustup.
# This is needed to get the cross toolchain as well.
apt-get -y remove rustc || true
Expand Down

0 comments on commit 53f388c

Please sign in to comment.