on: 
  pull_request:
    paths:
      - .github/actions/extism/**
      - .github/workflows/ci-go.yml
      - manifest/**
      - runtime/**
      - libextism/**
      - extism.go
      - extism_test.go
      - go.mod
      - libextism.pc 
      - go/**
  workflow_dispatch:

name: Go CI

jobs:
  go:
    name: Go
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest]
        rust:
          - stable
    steps:
      - name: Checkout sources
        uses: actions/checkout@v3
      - uses: ./.github/actions/extism
      - name: Setup Go env
        uses: actions/setup-go@v3

      - name: Test Go Host SDK
        run: |
          go version
          LD_LIBRARY_PATH=/usr/local/lib go test
          cd go
          LD_LIBRARY_PATH=/usr/local/lib go run main.go | grep "Hello from Go!"
