-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from Techatrix/dev
- Loading branch information
Showing
7 changed files
with
1,120 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
*.zig text=auto eol=lf | ||
*.zon text=auto eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,27 +2,49 @@ name: CI | |
|
||
on: | ||
push: | ||
branches: [ master ] | ||
branches: [master] | ||
pull_request: | ||
branches: [ master ] | ||
branches: [master] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: [ubuntu-latest, macos-latest, windows-latest] | ||
runs-on: ${{ matrix.platform }} | ||
|
||
zig-version: [master] | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
include: | ||
- zig-version: "0.12.1" | ||
os: ubuntu-latest | ||
- zig-version: "0.13.0" | ||
os: ubuntu-latest | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Zig | ||
uses: mlugg/setup-zig@v1 | ||
with: | ||
version: master | ||
|
||
- name: Run Tests | ||
run: zig build test --summary all | ||
|
||
- name: Setup `wasmtime` | ||
if: matrix.os == 'ubuntu-latest' | ||
uses: bytecodealliance/actions/wasmtime/setup@v1 | ||
with: | ||
version: "21.0.1" # Wasmtime v22.0.0 has removed support for the "Wasmtime 13-and-prior CLI" | ||
|
||
- name: Print wasmtime version | ||
if: matrix.os == 'ubuntu-latest' | ||
run: "wasmtime --version" | ||
|
||
- name: Setup Zig | ||
uses: goto-bus-stop/[email protected] | ||
with: | ||
version: master | ||
|
||
- name: Run tests | ||
run: | | ||
zig test known-folders.zig | ||
- name: Run Tests (wasm32-wasi) | ||
if: matrix.os == 'ubuntu-latest' | ||
run: zig build test -Dtarget=wasm32-wasi -fwasmtime --summary all | ||
env: | ||
WASMTIME_NEW_CLI: 0 | ||
WASMTIME_BACKTRACE_DETAILS: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,44 @@ | ||
const std = @import("std"); | ||
const builtin = @import("builtin"); | ||
|
||
const minimum_zig_version = std.SemanticVersion.parse("0.12.0") catch unreachable; | ||
|
||
pub fn build(b: *std.Build) void { | ||
if (comptime (builtin.zig_version.order(minimum_zig_version) == .lt)) { | ||
@compileError(std.fmt.comptimePrint( | ||
\\Your Zig version does not meet the minimum build requirement: | ||
\\ required Zig version: {[minimum_zig_version]} | ||
\\ actual Zig version: {[current_version]} | ||
\\ | ||
, .{ | ||
.current_version = builtin.zig_version, | ||
.minimum_zig_version = minimum_zig_version, | ||
})); | ||
} | ||
|
||
const target = b.standardTargetOptions(.{}); | ||
const optimize = b.standardOptimizeOption(.{}); | ||
|
||
const strip = b.option(bool, "strip", "Omit debug information"); | ||
const test_filters = b.option([]const []const u8, "test-filter", "Skip tests that do not match any filter") orelse &[0][]const u8{}; | ||
|
||
_ = b.addModule("known-folders", .{ | ||
.root_source_file = b.path("known-folders.zig"), | ||
.target = target, | ||
.optimize = optimize, | ||
.strip = strip, | ||
}); | ||
|
||
const unit_tests = b.addTest(.{ | ||
.root_source_file = b.path("known-folders.zig"), | ||
.target = target, | ||
.optimize = optimize, | ||
.strip = strip, | ||
.filters = test_filters, | ||
}); | ||
|
||
const run_unit_tests = b.addRunArtifact(unit_tests); | ||
|
||
const test_step = b.step("test", "Run unit tests"); | ||
test_step.dependOn(&run_unit_tests.step); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.