#Originally from https://raw.githubusercontent.com/intel/multus-cni/master/.github/workflows/go-build-test-amd64.yml
name: Go-build-and-test-amd64
on:
    push:
    pull_request:
    schedule:
      - cron: "0 8 * * 0" # every sunday
jobs:
  build:
    strategy:
      matrix:
        go-version: [1.13.x, 1.14.x, 1.15.x, 1.16.x]
        os: [ubuntu-latest]
    runs-on: ${{ matrix.os }}
    env:
      GO111MODULE: on
      TARGET: amd64
    steps:
      - name: Set up Go
        uses: actions/setup-go@v1
        with:
          go-version: ${{ matrix.go-version }}

      - name: Check out code into the Go module directory
        uses: actions/checkout@v2

      - name: Build
        run: GOARCH="${TARGET}" go build ./cmd/sriov/...

      - name: Go test
        run: sudo go test ./... # sudo needed for netns change in test
