From 91058760da5802113cc5692ed02064c00e4fd05f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Arrufat?= Date: Sat, 13 Apr 2024 15:56:20 +0900 Subject: [PATCH] Add CI --- .github/workflows/ci.yml | 57 ++++++++++++++++++++++++++++++++++++++++ Makefile | 4 +-- build.zig | 2 +- examples/index.html | 18 +++++++++++++ examples/main.js | 2 ++ examples/styles.css | 1 + 6 files changed, 81 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 examples/index.html create mode 100644 examples/main.js create mode 100644 examples/styles.css diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d0e6e9a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,57 @@ +name: CI - Zignal + +on: + push: + paths: + - ".github/workflows/ci.yml" + - "**.zig" + - "**.zon" + pull_request: + paths: + - ".github/workflows/ci.yml" + - "**.zig" + - "**.zon" + +jobs: + test: + strategy: + matrix: + include: + - zig-version: master + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Grab Zig + uses: goto-bus-stop/setup-zig@v2 + with: + version: ${{ matrix.zig-version }} + + - name: Native modules + run: | + make native + + - name: Linux modules + run: | + make linux + + - name: macOS modules + run: | + make macos + + - name: Windows modules + run: | + make windows + + - name: WebAssembly modules + run: | + make wasm + + - name: Tests master + run: | + make test diff --git a/Makefile b/Makefile index f401792..1a817d8 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ clean: rm -rf zig-out zig-cache serve: wasm - python -m http.server 8000 --bind 127.0.0.1 + python -m http.server 8000 -b 127.0.0.1 -d zig-out serve-debug: wasm-debug - python -m http.server 8000 --bind 127.0.0.1 + python -m http.server 8000 -b 127.0.0.1 -d zig-out diff --git a/build.zig b/build.zig index ed9f4fb..f7b664e 100644 --- a/build.zig +++ b/build.zig @@ -64,7 +64,7 @@ fn buildModule( ).step, ); b.installDirectory(.{ - .source_dir = .{ .path = "lib" }, + .source_dir = .{ .path = "examples" }, .install_dir = .prefix, .install_subdir = "", }); diff --git a/examples/index.html b/examples/index.html new file mode 100644 index 0000000..1086dd2 --- /dev/null +++ b/examples/index.html @@ -0,0 +1,18 @@ + + + + + + + Zignal Examples + + + + +
+

Zignal Examples

+
+ + + + diff --git a/examples/main.js b/examples/main.js new file mode 100644 index 0000000..de0b8cf --- /dev/null +++ b/examples/main.js @@ -0,0 +1,2 @@ +(function () { +})(); diff --git a/examples/styles.css b/examples/styles.css new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/examples/styles.css @@ -0,0 +1 @@ +