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 e8bd64b
Show file tree
Hide file tree
Showing 2 changed files with 15 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
13 changes: 13 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,18 @@ dub_fetch dubtestproject
dub build dubtestproject:test1 --compiler=ldc2
dub build dubtestproject:test2 --compiler=ldc2

# zig

ZIG_ARCHIVE=$(wget -qO- https://ziglang.org/download/index.json | jq -r ".master[\"$(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 e8bd64b

Please sign in to comment.