on: 
  pull_request:
    paths:
      - .github/actions/extism/**
      - .github/workflows/ci-zig.yml
      - manifest/**
      - runtime/**
      - libextism/**
      - zig/**
  workflow_dispatch:

name: Zig CI

jobs:
  zig:
    name: Zig
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest]
        zig_version: ["master"] # eventually use multiple versions once stable
        rust:
          - stable
    steps:
      - name: Checkout sources
        uses: actions/checkout@v3
      - uses: ./.github/actions/extism
      - name: Setup Zig env
        uses: goto-bus-stop/setup-zig@v2
        with: 
          version: ${{ matrix.zig_version }}

      - name: Test Zig Host SDK
        run: |
          zig version
          cd zig
          LD_LIBRARY_PATH=/usr/local/lib zig build test
