image: docker-registry.xx.network/elixxir/sysadmin/backend-ci:go1.17-wasm

stages:
  - wasm-test
  - go-test
  - build

build:
  stage: build
  script:
    - go mod vendor -v
    - mkdir -p release
    - GOOS=js GOARCH=wasm go build -ldflags '-w -s' -o release/xxdk.wasm main.go
  artifacts:
    paths:
      - release/

wasm-test:
  stage: wasm-test
  script:
    - export PATH=/root/go/bin:$PATH
    - GOOS=js GOARCH=wasm go test ./... -v

go-test:
  stage: go-test
  script:
    - go mod vendor -v
    - go test ./... -v
