From d1ef65ad671e604d297d3fe0b8c39aaebd90b69a Mon Sep 17 00:00:00 2001 From: Aleksandr Demakin Date: Tue, 3 Sep 2024 23:57:01 +0100 Subject: [PATCH 1/2] .github/workflows: update zig version. --- .github/workflows/test.yml | 79 ---------------------------------- .github/workflows/workflow.yml | 28 ++++++++++++ .gitignore | 1 + build.zig | 6 +-- 4 files changed, 32 insertions(+), 82 deletions(-) delete mode 100644 .github/workflows/test.yml create mode 100644 .github/workflows/workflow.yml 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..f32c7a3 --- /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 + with: + version: 0.13.0 + - uses: goto-bus-stop/setup-zig@v2 + - run: zig build test + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + version: 0.13.0 + - uses: goto-bus-stop/setup-zig@v2 + - 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, }); From dcc6b9b067e7376cd471ac099ca62ee98fcb12f0 Mon Sep 17 00:00:00 2001 From: Aleksandr Demakin Date: Tue, 3 Sep 2024 23:59:33 +0100 Subject: [PATCH 2/2] .github/workflows: update zig version. --- .github/workflows/workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index f32c7a3..282e918 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -14,15 +14,15 @@ jobs: runs-on: ${{matrix.os}} steps: - uses: actions/checkout@v2 + - uses: goto-bus-stop/setup-zig@v2 with: version: 0.13.0 - - uses: goto-bus-stop/setup-zig@v2 - 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 - - uses: goto-bus-stop/setup-zig@v2 - run: zig fmt --check . \ No newline at end of file