-
Notifications
You must be signed in to change notification settings - Fork 0
155 lines (128 loc) · 4.03 KB
/
ci.yml
File metadata and controls
155 lines (128 loc) · 4.03 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-D warnings"
jobs:
check:
name: Check & Test
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
- name: Install protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- name: Format
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --all-targets --all-features
- name: Test
run: cargo test --all
docker:
name: Docker Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: useblacksmith/setup-docker-builder@v1
- name: Build Docker image
uses: useblacksmith/build-push-action@v2
with:
context: .
file: infra/Dockerfile
push: false
tags: warpgrid:ci
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Verify binary works
run: docker run --rm warpgrid:ci --help
wasi-libc:
name: Build & Test wasi-libc
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
- name: Install wasmtime
uses: bytecodealliance/actions/wasmtime/setup@v1
with:
version: "v41.0.0"
- name: Cache wasi-sdk
id: cache-wasi-sdk
uses: actions/cache@v4
with:
path: build/cache
key: wasi-sdk-30.0-x86_64-linux
- name: Cache wasi-libc source
uses: actions/cache@v4
with:
path: |
build/src-stock
build/src-patched
key: wasi-libc-${{ hashFiles('libc-patches/UPSTREAM_REF') }}
- name: Build stock wasi-libc
run: scripts/build-libc.sh --stock
- name: Build patched wasi-libc
run: scripts/build-libc.sh --patched
- name: Test both sysroots
run: scripts/test-libc.sh --all
tinygo:
name: Build & Verify TinyGo
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Install wasmtime
uses: bytecodealliance/actions/wasmtime/setup@v1
with:
version: "v41.0.0"
- name: Install wasm-tools
run: cargo install wasm-tools
- name: Install wasm-opt (binaryen)
run: sudo apt-get update && sudo apt-get install -y binaryen
- name: Cache TinyGo download
id: cache-tinygo-download
uses: actions/cache@v4
with:
path: build/cache
key: tinygo-${{ env.TINYGO_TAG || 'v0.40.0' }}-linux-amd64
- name: Cache TinyGo source
id: cache-tinygo-source
uses: actions/cache@v4
with:
path: vendor/tinygo
key: tinygo-source-${{ env.TINYGO_TAG || 'v0.40.0' }}
- name: Build TinyGo
run: scripts/build-tinygo.sh --download
- name: Verify TinyGo
run: scripts/build-tinygo.sh --verify
componentize-js:
name: Build & Verify ComponentizeJS
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install wasm-tools
run: cargo install wasm-tools
- name: Cache ComponentizeJS npm install
uses: actions/cache@v4
with:
path: build/componentize-js/node_modules
key: componentize-js-npm-${{ hashFiles('scripts/build-componentize-js.sh') }}
- name: Cache ComponentizeJS source
uses: actions/cache@v4
with:
path: vendor/componentize-js
key: componentize-js-source-${{ hashFiles('scripts/build-componentize-js.sh') }}
- name: Build ComponentizeJS
run: scripts/build-componentize-js.sh --npm
- name: Verify ComponentizeJS
run: scripts/build-componentize-js.sh --verify