Skip to content

Commit

Permalink
Merge pull request #4 from adamreese/test/gh-actions
Browse files Browse the repository at this point in the history
ci: add github actions for testing
  • Loading branch information
adamreese authored Sep 18, 2024
2 parents 92d0b8d + 47b2078 commit c2d4ef2
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 6 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.20'

- name: Setup TinyGo
uses: acifani/setup-tinygo@v2
with:
tinygo-version: '0.28.0'

- name: Setup Spin
uses: fermyon/actions/spin/setup@v1
with:
version: "v2.6.0"

- name: Setup Wasmtime
uses: bytecodealliance/actions/wasmtime/setup@v1
with:
version: "13.0.1"

- name: Run unit tests
run: make test

- name: Run integration tests
run: make test-integration
8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,14 @@ VERSION = 2.3.0-pre0
# Test
# ----------------------------------------------------------------------
.PHONY: test
test: test-integration
test: test
tinygo test -target=wasi -gc=leaking -v ./http
tinygo test -target=wasi -gc=leaking -v ./redis

.PHONY: test-integration
test-integration: http/testdata/http-tinygo/main.wasm
test-integration:
go test -v -count=1 .

http/testdata/http-tinygo/main.wasm: generate
http/testdata/http-tinygo/main.wasm: http/testdata/http-tinygo/main.go
tinygo build -target=wasi -gc=leaking -no-debug -o http/testdata/http-tinygo/main.wasm http/testdata/http-tinygo/main.go

# ----------------------------------------------------------------------
# Generate C bindings
# ----------------------------------------------------------------------
Expand Down

0 comments on commit c2d4ef2

Please sign in to comment.