stages:
  - "build"
  - "test"
  - "publish"

build_job:
  stage: build
  image: public.ecr.aws/docker/library/golang:1.21
  parallel:
    matrix:
      - GOOS:
          - linux
          - darwin
          - windows
      - GOARCH:
          - amd64
          - arm64
  script: |
    go build \
    -o webservice_$GOOS_$GOARCH.bin \
    ./*.go

test_job:
  stage: test
  image: public.ecr.aws/docker/library/golang:1.21
  script:
    - go get -t ./...
    - go test -race -v ./...

publish_job:
  stage: publish
  image: public.ecr.aws/ubuntu/ubuntu:22.04_stable
  script: echo publishing now
