Skip to content

Commit

Permalink
Add Windows CI
Browse files Browse the repository at this point in the history
  • Loading branch information
rbino committed Aug 4, 2024
1 parent 1841db5 commit e6062a2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ jobs:
# These actually are not relevant since brew just pulls the latest version
otp: "latest"
elixir: "latest"
- os: windows-2022
otp: "27.0.1"
elixir: "1.17.2"

steps:
- name: Clone the repository
Expand All @@ -117,14 +120,20 @@ jobs:
run: |
curl -Lo tigerbeetle.zip https://mac.tigerbeetle.com && unzip tigerbeetle.zip
- name: Fetch TigerBeetle for Windows
if: runner.os == 'Windows'
working-directory: ./src/tigerbeetle
run: |
curl.exe -Lo tigerbeetle.zip https://windows.tigerbeetle.com; Expand-Archive tigerbeetle.zip .
- name: Start TigerBeetle
working-directory: ./src/tigerbeetle
run: |
./tigerbeetle format --cluster=0 --replica=0 --replica-count=1 --development 0_0.tigerbeetle
./tigerbeetle start --addresses=3000 --development 0_0.tigerbeetle &
- name: Install OTP and Elixir
if: runner.os == 'Linux'
if: runner.os == 'Linux' || runner.os == 'Windows'
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
Expand Down
4 changes: 3 additions & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ pub fn build(b: *std.Build) void {
// Do this so `lib` doesn't get prepended to the lib name, and `.so` is used as suffix also
// on MacOS, since it's required by the NIF loading mechanism.
// See https://github.com/ziglang/zig/issues/2231
const nif_so_install = b.addInstallFileWithDir(lib.getEmittedBin(), .lib, "tigerbeetlex.so");
// Windows still needs the .dll suffix
const lib_name = if (target.result.os.tag == .windows) "tigerbeetlex.dll" else "tigerbeetlex.so";
const nif_so_install = b.addInstallFileWithDir(lib.getEmittedBin(), .lib, lib_name);
nif_so_install.step.dependOn(&lib.step);
b.getInstallStep().dependOn(&nif_so_install.step);
}

0 comments on commit e6062a2

Please sign in to comment.