fix(ci): use nix instead of ubuntu
Some checks failed
Build Zenyx ⚡ / 🧪 Run Cargo Tests (push) Has been cancelled
Build Zenyx ⚡ / 🏗️ Build aarch64-unknown-linux-gnu (push) Has been cancelled
Build Zenyx ⚡ / 🏗️ Build universal2-apple-darwin (push) Has been cancelled
Build Zenyx ⚡ / 🏗️ Build x86_64-unknown-linux-gnu (push) Has been cancelled
Build Zenyx ⚡ / 🏗️ Build aarch64-pc-windows-msvc (push) Has been cancelled
Build Zenyx ⚡ / 🏗️ Build x86_64-pc-windows-msvc (push) Has been cancelled
Build Zenyx ⚡ / 🔧 Setup Environment (push) Has been cancelled

This commit is contained in:
Chance 2025-04-21 21:30:30 -04:00
parent b97dd094e1
commit 251d58c897
Signed by: caznix
GPG key ID: 489D213143D753FD
2 changed files with 92 additions and 1 deletions

View file

@ -0,0 +1,80 @@
name: Build Zenyx ⚡
on:
push:
pull_request:
types: [opened, synchronize, reopened]
jobs:
cargo-test:
name: 🧪 Run Cargo Tests
runs-on: nixos-latest
steps:
- name: 📥 Checkout source
uses: https://github.com/actions/checkout@v4
- name: 🚀 Setup & Run tests
run: |
nix-shell --run "
git-lfs fetch
git-lfs pull
cargo test --release --all
"
build:
name: 🏗️ Build ${{ matrix.target }}
needs: [cargo-test]
runs-on: nixos-latest
strategy:
fail-fast: false
matrix:
target:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu
- x86_64-pc-windows-msvc
- aarch64-pc-windows-msvc
include:
- target: x86_64-unknown-linux-gnu
binary_name: zenyx-x86_64-linux
ext: ""
command: zigbuild
args: --target x86_64-unknown-linux-gnu --release
- target: aarch64-unknown-linux-gnu
binary_name: zenyx-aarch64-linux
ext: ""
command: zigbuild
args: --target aarch64-unknown-linux-gnu --release
- target: x86_64-pc-windows-msvc
binary_name: zenyx-x86_64-windows
ext: ".exe"
command: xwin build
args: --target x86_64-pc-windows-msvc --release
- target: aarch64-pc-windows-msvc
binary_name: zenyx-aarch64-windows
ext: ".exe"
command: xwin build
args: --target aarch64-pc-windows-msvc --release
steps:
- name: 📥 Checkout source
uses: https://github.com/actions/checkout@v4
- name: 🚀 Install Target & Build release binary
run: |
nix-shell --run "
git-lfs fetch --all
git-lfs pull
cargo ${{ matrix.command }} ${{ matrix.args }}
"
- name: 📦 Package artifact
run: |
mkdir -p artifacts
cp target/${{ matrix.target }}/release/zenyx${{ matrix.ext }} artifacts/${{ matrix.binary_name }}${{ matrix.ext }}
- name: ⬆️ Upload artifact
uses: https://code.forgejo.org/forgejo/upload-artifact@v4
with:
name: ${{ matrix.binary_name }}${{ matrix.ext }}
path: artifacts/${{ matrix.binary_name }}${{ matrix.ext }}
if-no-files-found: error

View file

@ -41,6 +41,9 @@
cargo-cross
cargo-xwin
cargo-wizard
git
git-lfs
zig_0_12
wine64
pkg-config
];
@ -73,7 +76,15 @@
nativeBuildInputs = with pkgs; [
(rust-bin.stable.latest.default.override {
extensions = ["rust-src" "cargo" "rustfmt" "clippy"];
targets = [ "x86_64-pc-windows-msvc" "x86_64-unknown-linux-gnu" ];
targets = [
"x86_64-pc-windows-msvc"
"x86_64-unknown-linux-gnu"
"x86_64-apple-darwin"
"aarch64-unknown-linux-gnu"
"aarch64-pc-windows-msvc"
"aarch64-apple-darwin"
# "universal2-apple-darwin"
];
})
pkg-config