-
Notifications
You must be signed in to change notification settings - Fork 106
91 lines (76 loc) · 2.43 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Continuous Integration
env:
# Specify the current Zig version MicroZig uses:
ZIG_VERSION: 0.11.0
DEPLOYMENT_URL: "https://download.microzig.tech"
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
generate-packages:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-tags: true # required for "git describe"
- name: Fetch more data from git
run: |
# fetch everything back till the $(ZIG_VERSION) tag.
# https://stackoverflow.com/a/58082274
git fetch --shallow-exclude ${{ env.ZIG_VERSION }}
git fetch --deepen=2
- name: Setup Zig
uses: goto-bus-stop/setup-zig@v2
with:
version: ${{ env.ZIG_VERSION }}
- name: Install PIP packages
run: |
pip install dataclasses_json==0.6.3 marshmallow typing-inspect semver pathspec
- name: Generate and validate packages
run: |
./tools/bundle.py
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: packages
path: microzig-deploy/
validate-packages:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-tags: true # required for "git describe"
- name: Fetch more data from git
run: |
# fetch everything back till the $(ZIG_VERSION) tag.
# https://stackoverflow.com/a/58082274
git fetch --shallow-exclude ${{ env.ZIG_VERSION }}
git fetch --deepen=2
- name: Setup Zig
uses: goto-bus-stop/setup-zig@v2
with:
version: ${{ env.ZIG_VERSION }}
- name: Install PIP packages
run: |
pip install dataclasses_json==0.6.3 marshmallow typing-inspect semver pathspec
- name: Generate packages
run: |
./tools/bundle.py --debug
- name: Spawn local web server
uses: Eun/http-server-action@v1
with:
directory: "${{ github.workspace }}/microzig-deploy"
port: 8080
content-types: |
{
"gz": "application/gzip",
"json": "application/json"
}
- name: Validate examples
run: |
mkdir -p "${{ github.workspace }}/microzig-test"
./tools/validate-all-examples.sh --build-root "${{ github.workspace }}/microzig-test"