Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
arrufat committed Apr 13, 2024
1 parent 9676958 commit 9105876
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 3 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fn buildModule(
).step,
);
b.installDirectory(.{
.source_dir = .{ .path = "lib" },
.source_dir = .{ .path = "examples" },
.install_dir = .prefix,
.install_subdir = "",
});
Expand Down
18 changes: 18 additions & 0 deletions examples/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Zignal Examples</title>
<link rel="stylesheet" href="./style.css">
<link rel="icon" href="./favicon.ico" type="image/x-icon">
</head>
<body>
<main>
<h1>Zignal Examples</h1>
</main>
<script src="index.js"></script>
</body>
</html>

2 changes: 2 additions & 0 deletions examples/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(function () {
})();
1 change: 1 addition & 0 deletions examples/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

0 comments on commit 9105876

Please sign in to comment.