Skip to content

Commit

Permalink
feat: Windows support
Browse files Browse the repository at this point in the history
  • Loading branch information
giann committed Jan 24, 2025
1 parent 8ba80e8 commit 573ad85
Show file tree
Hide file tree
Showing 9 changed files with 464 additions and 354 deletions.
177 changes: 110 additions & 67 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
on:
push:
branches: [main]
branches: [main, windows]
pull_request:
branches: [main]

jobs:
test-macos:
runs-on: macos-latest
test-windows:
runs-on: windows-latest
steps:
- name: Install homebrew
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- name: Checkout project
uses: actions/[email protected]
- name: Checkout submodules
Expand All @@ -19,7 +17,10 @@ jobs:
with:
version: master
- name: Build test ffi lib
run: zig build-lib -dynamic tests/utils/foreign.zig && mv libforeign.* tests/utils/
run: zig build-lib -dynamic tests/utils/foreign.zig && mv foreign.* tests/utils/

- name: Debug
run: zig build && ls ./zig-out/lib/buzz

- name: Run tests Debug
run: zig build test
Expand Down Expand Up @@ -47,67 +48,109 @@ jobs:
run: zig build -Doptimize=ReleaseFast -Djit_always_on test
- name: Cleanup
run: rm -rf zig-out zig-cache
test-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/[email protected]
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Setup nightly Zig
uses: mlugg/setup-zig@v1
with:
version: master
- name: Build test ffi lib
run: zig build-lib -dynamic tests/utils/foreign.zig && mv libforeign.* tests/utils/
# test-macos:
# runs-on: macos-latest
# steps:
# - name: Install homebrew
# run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# - name: Checkout project
# uses: actions/[email protected]
# - name: Checkout submodules
# run: git submodule update --init --recursive
# - name: Setup nightly Zig
# uses: mlugg/setup-zig@v1
# with:
# version: master
# - name: Build test ffi lib
# run: zig build-lib -dynamic tests/utils/foreign.zig && mv libforeign.* tests/utils/

- name: Run tests Debug
run: zig build test
- name: Cleanup
run: rm -rf zig-out zig-cache
- name: Run tests Debug with JIT always on
run: zig build -Djit_always_on test
- name: Cleanup
run: rm -rf zig-out zig-cache
# - name: Run tests Debug
# run: zig build test
# - name: Cleanup
# run: rm -rf zig-out zig-cache
# - name: Run tests Debug with JIT always on
# run: zig build -Djit_always_on test
# - name: Cleanup
# run: rm -rf zig-out zig-cache

- name: Run tests ReleaseSafe
run: zig build -Doptimize=ReleaseSafe test
- name: Cleanup
run: rm -rf zig-out zig-cache
- name: Run tests ReleaseSafe with JIT always on
run: zig build -Doptimize=ReleaseSafe -Djit_always_on test
- name: Cleanup
run: rm -rf zig-out zig-cache
# - name: Run tests ReleaseSafe
# run: zig build -Doptimize=ReleaseSafe test
# - name: Cleanup
# run: rm -rf zig-out zig-cache
# - name: Run tests ReleaseSafe with JIT always on
# run: zig build -Doptimize=ReleaseSafe -Djit_always_on test
# - name: Cleanup
# run: rm -rf zig-out zig-cache

- name: Run tests ReleaseFast
run: zig build -Doptimize=ReleaseFast test
- name: Cleanup
run: rm -rf zig-out zig-cache
- name: Run tests ReleaseFast with JIT always on
run: zig build -Doptimize=ReleaseFast -Djit_always_on test
- name: Cleanup
run: rm -rf zig-out zig-cache
wasm-build:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/[email protected]
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Setup nightly Zig
uses: mlugg/setup-zig@v1
with:
version: master
- name: Build for wasm
run: zig build -Dtarget=wasm32-freestanding -freference-trace -Doptimize=ReleaseSmall
- name: Cleanup
run: rm -rf zig-out zig-cache
lint:
runs-on: macos-latest
steps:
- uses: actions/[email protected]
- name: Setup nightly Zig
uses: mlugg/setup-zig@v1
with:
version: master
- run: zig fmt --check src/*.zig src/**/*.zig
# - name: Run tests ReleaseFast
# run: zig build -Doptimize=ReleaseFast test
# - name: Cleanup
# run: rm -rf zig-out zig-cache
# - name: Run tests ReleaseFast with JIT always on
# run: zig build -Doptimize=ReleaseFast -Djit_always_on test
# - name: Cleanup
# run: rm -rf zig-out zig-cache
# test-linux:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout project
# uses: actions/[email protected]
# - name: Checkout submodules
# run: git submodule update --init --recursive
# - name: Setup nightly Zig
# uses: mlugg/setup-zig@v1
# with:
# version: master
# - name: Build test ffi lib
# run: zig build-lib -dynamic tests/utils/foreign.zig && mv libforeign.* tests/utils/

# - name: Run tests Debug
# run: zig build test
# - name: Cleanup
# run: rm -rf zig-out zig-cache
# - name: Run tests Debug with JIT always on
# run: zig build -Djit_always_on test
# - name: Cleanup
# run: rm -rf zig-out zig-cache

# - name: Run tests ReleaseSafe
# run: zig build -Doptimize=ReleaseSafe test
# - name: Cleanup
# run: rm -rf zig-out zig-cache
# - name: Run tests ReleaseSafe with JIT always on
# run: zig build -Doptimize=ReleaseSafe -Djit_always_on test
# - name: Cleanup
# run: rm -rf zig-out zig-cache

# - name: Run tests ReleaseFast
# run: zig build -Doptimize=ReleaseFast test
# - name: Cleanup
# run: rm -rf zig-out zig-cache
# - name: Run tests ReleaseFast with JIT always on
# run: zig build -Doptimize=ReleaseFast -Djit_always_on test
# - name: Cleanup
# run: rm -rf zig-out zig-cache
# wasm-build:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout project
# uses: actions/[email protected]
# - name: Checkout submodules
# run: git submodule update --init --recursive
# - name: Setup nightly Zig
# uses: mlugg/setup-zig@v1
# with:
# version: master
# - name: Build for wasm
# run: zig build -Dtarget=wasm32-freestanding -freference-trace -Doptimize=ReleaseSmall
# - name: Cleanup
# run: rm -rf zig-out zig-cache
# lint:
# runs-on: macos-latest
# steps:
# - uses: actions/[email protected]
# - name: Setup nightly Zig
# uses: mlugg/setup-zig@v1
# with:
# version: master
# - run: zig fmt --check src/*.zig src/**/*.zig
108 changes: 1 addition & 107 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,109 +1,3 @@
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## User settings
xcuserdata/

## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout

## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
DerivedData/
*.moved-aside
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3

## Obj-C/Swift specific
*.hmap

## App packaging
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
# *.xcodeproj
#
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
# hence it is not needed unless you have added a package configuration file to your project
# .swiftpm

.build/

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/
#
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build/

# Accio dependency management
Dependencies/
.accio/

# fastlane
#
# It is recommended to not store the screenshots in the git repo.
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output

# Code Injection
#
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/

# Extension
node_modules/

# Rust
# Generated by Cargo
# will have compiled files and executables
debug/
target/

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

# zig
zig-cache/
\.zig-cache/
Expand All @@ -118,5 +12,5 @@ dist/
*.so
*.o

tests/utils/libforeign.*
tests/utils/*foreign.*
buzz_history
Loading

0 comments on commit 573ad85

Please sign in to comment.