Merge pull request #18 from extism/readme-and-improvements #91
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push, pull_request] | |
jobs: | |
test-example: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
rust: | |
- stable | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
path: go-pdk | |
- uses: ./go-pdk/.github/actions/libextism | |
- run: cp go-pdk/go.sum . # Needed to get setup-go to work | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
cache: true | |
go-version: '1.21.1' | |
- name: Install TinyGo | |
uses: acifani/setup-tinygo@v1.1.0 | |
with: | |
tinygo-version: 0.30.0 | |
binaryen-version: "116" | |
- name: Compile example | |
run: | | |
pushd go-pdk | |
ls -a | |
pushd example | |
go mod download | |
popd | |
make -B example | |
- name: Test example | |
run: | | |
cd go-pdk | |
# --wasi is needed as there is currently some issue compiling Go PDK plugins without wasi | |
TEST=$(extism call example/example.wasm --wasi --input "this is a test" --set-config='{"thing": "1", "a": "b"}' count_vowels) | |
echo $TEST | grep '"count": 4' | |
echo $TEST | grep '"config": "1"' | |
echo $TEST | grep '"a": "this is var a"' | |
extism call example/http.wasm --wasi http_get --allow-host "jsonplaceholder.typicode.com" | grep '"userId": 1' |