DEV Community

voluntas
voluntas

Posted on

2 2

GitHub Actions 利用時に misc/wasm にパスを通す

Go で "syscall/js" を利用してるとテストを実行したときに $GOROOT/misc/wasm 以下にパスが通ってる必要があります。

go env GOROOT を活用すれば簡単です。

name: main

on:
  push:
  pull_request:

jobs:
  main:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-go@v2
        with:
          go-version: 1.14
      - uses: actions/checkout@v2
      - run: |
          export PATH=$(go env GOROOT)/misc/wasm:$PATH
          make test
Enter fullscreen mode Exit fullscreen mode

一応 makefile も載せておきます。

all:
    GOOS=js GOARCH=wasm go build -o wasm.wasm


test:
    GOOS=js GOARCH=wasm go test
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post