name: Go
on: [push, pull_request]
jobs:

  test:
    name: Test
    runs-on: ubuntu-latest
    steps:
    - name: Set up Go 1.13
      uses: actions/setup-go@v1
      with:
        go-version: 1.13
      id: go

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

    - name: Get dependencies
      run: |
        go get -v -t -d ./...

    - name: Format check
      run: |
        GOBIN=$PWD/bin go install golang.org/x/tools/cmd/goimports
        PATH="$PATH:$PWD/bin" make fmt-check

    - name: Lint
      run: |
        GOBIN="$PWD/bin" go install golang.org/x/lint/golint
        PATH="$PATH:$PWD/bin" make lint

    - name: Test
      run: make test
      env:
        SORACOM_EMAIL_FOR_TEST: ${{ secrets.SORACOM_EMAIL_FOR_TEST }}
        SORACOM_PASSWORD_FOR_TEST: ${{ secrets.SORACOM_PASSWORD_FOR_TEST }}
        SORACOM_AUTHKEY_ID_FOR_TEST: ${{ secrets.SORACOM_AUTHKEY_ID_FOR_TEST }}
        SORACOM_AUTHKEY_FOR_TEST: ${{ secrets.SORACOM_AUTHKEY_FOR_TEST }}

name: Go
on: [push, pull_request]
jobs:

  test:
    name: Test
    runs-on: ubuntu-latest
    steps:
    - name: Set up Go 1.13
      uses: actions/setup-go@v1
      with:
        go-version: 1.13
      id: go

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

    - name: Get dependencies
      run: |
        go get -v -t -d ./...

    - name: Format check
      run: |
        GOBIN=$PWD/bin go install golang.org/x/tools/cmd/goimports
        PATH="$PATH:$PWD/bin" make fmt-check

    - name: Lint
      run: |
        GOBIN="$PWD/bin" go install golang.org/x/lint/golint
        PATH="$PATH:$PWD/bin" make lint

    - name: Test
      run: make test
      env:
        SORACOM_EMAIL_FOR_TEST: ${{ secrets.SORACOM_EMAIL_FOR_TEST }}
        SORACOM_PASSWORD_FOR_TEST: ${{ secrets.SORACOM_PASSWORD_FOR_TEST }}
        SORACOM_AUTHKEY_ID_FOR_TEST: ${{ secrets.SORACOM_AUTHKEY_ID_FOR_TEST }}
        SORACOM_AUTHKEY_FOR_TEST: ${{ secrets.SORACOM_AUTHKEY_FOR_TEST }}

Use actions/checkout@v2 for GitHub Actions
Use actions/checkout@v2 for GitHub Actions
