Skip to content

Commit c2d4ef2

Browse files
authored
Merge pull request #4 from adamreese/test/gh-actions
ci: add github actions for testing
2 parents 92d0b8d + 47b2078 commit c2d4ef2

File tree

2 files changed

+42
-6
lines changed

2 files changed

+42
-6
lines changed

.github/workflows/build.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
name: Test
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup Go
17+
uses: actions/setup-go@v5
18+
with:
19+
go-version: '1.20'
20+
21+
- name: Setup TinyGo
22+
uses: acifani/setup-tinygo@v2
23+
with:
24+
tinygo-version: '0.28.0'
25+
26+
- name: Setup Spin
27+
uses: fermyon/actions/spin/setup@v1
28+
with:
29+
version: "v2.6.0"
30+
31+
- name: Setup Wasmtime
32+
uses: bytecodealliance/actions/wasmtime/setup@v1
33+
with:
34+
version: "13.0.1"
35+
36+
- name: Run unit tests
37+
run: make test
38+
39+
- name: Run integration tests
40+
run: make test-integration

Makefile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,14 @@ VERSION = 2.3.0-pre0
44
# Test
55
# ----------------------------------------------------------------------
66
.PHONY: test
7-
test: test-integration
7+
test: test
88
tinygo test -target=wasi -gc=leaking -v ./http
99
tinygo test -target=wasi -gc=leaking -v ./redis
1010

1111
.PHONY: test-integration
12-
test-integration: http/testdata/http-tinygo/main.wasm
12+
test-integration:
1313
go test -v -count=1 .
1414

15-
http/testdata/http-tinygo/main.wasm: generate
16-
http/testdata/http-tinygo/main.wasm: http/testdata/http-tinygo/main.go
17-
tinygo build -target=wasi -gc=leaking -no-debug -o http/testdata/http-tinygo/main.wasm http/testdata/http-tinygo/main.go
18-
1915
# ----------------------------------------------------------------------
2016
# Generate C bindings
2117
# ----------------------------------------------------------------------

0 commit comments

Comments
 (0)