diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index fe5d68e..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,79 +0,0 @@ -name: test - -on: - push: - branches: [main, dev] - pull_request: - branches: [main, dev] - -jobs: - lint: - runs-on: ubuntu-latest - - steps: - - name: checkout - uses: actions/checkout@v2 - - - name: setup-zig - uses: goto-bus-stop/setup-zig@v2 - with: - version: 0.11.0 - - - name: lint - run: | - zig fmt --check src/ - zig fmt --check build.zig - - build-unix: - strategy: - matrix: - os: [ubuntu-latest, macos-latest] - - runs-on: ${{matrix.os}} - - steps: - - name: checkout - uses: actions/checkout@v2 - with: - submodules: recursive - - - name: setup-zig - uses: goto-bus-stop/setup-zig@v2 - with: - version: 0.11.0 - - - name: build - run: zig build - - - name: test - run: zig build test - - build-windows: - runs-on: windows-latest - defaults: - run: - shell: bash - - steps: - - name: setup-git - run: | - git config --global core.autocrlf false - git config --global core.eol lf - - - name: checkout - uses: actions/checkout@v2 - with: - submodules: recursive - - - name: setup-zig - uses: goto-bus-stop/setup-zig@v2 - with: - version: 0.11.0 - - - name: build - run: | - zig build -Dtarget=x86_64-windows --prefix tmp - zig build - - - name: test - run: zig build test diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 0000000..282e918 --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,28 @@ +name: test + +on: + push: + branches: [main, dev] + pull_request: + branches: [main, dev] + +jobs: + test: + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{matrix.os}} + steps: + - uses: actions/checkout@v2 + - uses: goto-bus-stop/setup-zig@v2 + with: + version: 0.13.0 + - run: zig build test + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: goto-bus-stop/setup-zig@v2 + with: + version: 0.13.0 + - run: zig fmt --check . \ No newline at end of file diff --git a/.gitignore b/.gitignore index 312d8fd..99be26f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /zig-cache /zig-out /.vscode +/.zig-cache diff --git a/build.zig b/build.zig index 8c1d500..8d8bb0b 100644 --- a/build.zig +++ b/build.zig @@ -8,19 +8,19 @@ pub fn build(b: *std.Build) void { const lib = b.addStaticLibrary(.{ .name = package_name, - .root_source_file = .{ .src_path = .{ .owner = b, .sub_path = package_path }}, + .root_source_file = .{ .src_path = .{ .owner = b, .sub_path = package_path } }, .target = target, .optimize = optimize, }); _ = b.addModule(package_name, .{ - .root_source_file = .{ .src_path = .{ .owner = b, .sub_path = package_path }}, + .root_source_file = .{ .src_path = .{ .owner = b, .sub_path = package_path } }, }); b.installArtifact(lib); const main_tests = b.addTest(.{ - .root_source_file = .{ .src_path = .{ .owner = b, .sub_path = "src/tests.zig" }}, + .root_source_file = .{ .src_path = .{ .owner = b, .sub_path = "src/tests.zig" } }, .target = target, .optimize = optimize, });