Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add github actions for testing #4

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps Go 1.23 here?


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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about TinyGo 0.33.0 here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above comment #4 (comment)


- 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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, do we want to use one of the latest version of wasmtime maybe?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need wasmtime 13 because it's the latest version that works with TinyGo 0.28. TinyGo 0.29 is when net/http was removed and all the Transport bits in the client stopped working. I'll a some note about somewhere

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifically --map-dir was removed from wasmtime in v14


- 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

# ----------------------------------------------------------------------
# Build examples
# ----------------------------------------------------------------------
Expand Down