Skip to content

fix: use extism:host/env #98

fix: use extism:host/env

fix: use extism:host/env #98

Workflow file for this run

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/[email protected]
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 --github-token="$GITHUB_TOKEN" --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 --github-token="$GITHUB_TOKEN" --wasi http_get --allow-host "jsonplaceholder.typicode.com" | grep '"userId": 1'