on: [push, pull_request]
name: Test
jobs:
  test:
    strategy:
      matrix:
        go-version: [1.14.x, 1.15.x, 1.16.x]
    runs-on: ubuntu-latest
    steps:
    - name: Install Go
      uses: actions/setup-go@v1
      with:
        go-version: ${{ matrix.go-version }}

    - name: Install wasmbrowsertest
      run: |
        go get github.com/agnivade/wasmbrowsertest
        mv $HOME/go/bin/wasmbrowsertest $HOME/go/bin/go_js_wasm_exec

    - name: Checkout code
      uses: actions/checkout@v2

    - name: Test
      run: go test -exec="$HOME/go/bin/go_js_wasm_exec" ./...
      env:
        GOOS: js
        GOARCH: wasm