-
Notifications
You must be signed in to change notification settings - Fork 5
50 lines (42 loc) · 1.69 KB
/
go-test.yaml
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
name: go tests
on:
push:
tags:
- v*
branches:
- master
- main
pull_request:
jobs:
# Note: TinyGo is not idempotent when generating wasm, so we don't check in
# %.wasm as a part of this job.
build:
runs-on: ubuntu-latest
strategy:
# To simplify setup, we use one Go version, even if it is out of the official version range.
# This version must be <= max version of earliest TinyGo supported and >= min version of latest.
matrix:
go-version: # Note: Go only supports 2 versions: https://go.dev/doc/devel/release#policy
- "1.18" # Minimum Go version of latest TinyGo even if EOL.
tinygo-version: # Note: TinyGo only supports latest: https://github.com/tinygo-org/tinygo/releases
- "0.23.0" # Earliest version to support 1.18
- "0.26.0" # Latest
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Install TinyGo
run: | # Installing via curl so commands are similar on OS/x
tinygo_version=${{ matrix.tinygo-version }}
curl -sSL https://github.com/tinygo-org/tinygo/releases/download/v${tinygo_version}/tinygo${tinygo_version}.linux-amd64.tar.gz | sudo tar -C /usr/local -xzf -
echo "TINYGOROOT=/usr/local/tinygo" >> $GITHUB_ENV
echo "/usr/local/tinygo/bin" >> $GITHUB_PATH
- name: Checkout
uses: actions/checkout@v3
- name: Build example
run: tinygo build -o example/hello.wasm -scheduler=none --no-debug -target=wasi example/hello.go
- name: Build test wasm
run: cd internal/e2e; make
- name: Test
run: go test -v ./...