name: Go

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:

  build:
    name: Build
    runs-on: ubuntu-latest
    steps:

    - name: Set up Go 1.x
      uses: actions/setup-go@v2
      with:
        go-version: ^1.13
      id: go

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

    - name: Ensure all files were formatted as per gofmt
      run: |
        gofmt -l $(find . -name '*.go') >/dev/null

    - name: Go Vet
      run: |
        go vet ./...

    - name: Build
      run: go build -v ./...

  test:
    name: Test 
    runs-on: ubuntu-latest
    steps:

    - name: Set up Go 1.x
      uses: actions/setup-go@v2
      with:
        go-version: ^1.13
      id: go

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

    - name: Test
      run: go test -v ./...

name: Go

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:

  build:
    name: build
    runs-on: ubuntu-latest
    steps:

    - name: Set up Go 1.x
      uses: actions/setup-go@v2
      with:
        go-version: ^1.13
      id: go

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

    - name: Ensure all files were formatted as per gofmt
      run: |
        gofmt -l $(find . -name '*.go') >/dev/null

    - name: Go Vet
      run: |
        go vet ./...

    - name: Build
      run: go build -v ./...
 
  test:
    name: test 
    runs-on: ubuntu-latest
    steps:

    - name: Set up Go 1.x
      uses: actions/setup-go@v2
      with:
        go-version: ^1.13
      id: go

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

    - name: Test
      run: go test -v ./...
  
  gofmt:
    name: gofmt
    runs-on: ubuntu-latest
    steps:

    - name: Set up Go 1.x
      uses: actions/setup-go@v2
      with:
        go-version: ^1.13
      id: go

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

    - name: Ensure all files were formatted as per gofmt
      run: |
        gofmt -l $(find . -name '*.go') >/dev/null

  vet:
    name: vet
    runs-on: ubuntu-latest
    steps:

    - name: Set up Go 1.x
      uses: actions/setup-go@v2
      with:
        go-version: ^1.13
      id: go

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

    - name: Go Vet
      run: |
        go vet ./...

Split GitHub actions into build, test, vet, gofmt
Split GitHub actions into build, test, vet, gofmt