on: [ push, pull_request ]
name: Test
jobs:
  test:
    strategy:
      matrix:
        go-version: [ 1.13.x, 1.14.x ]
        goarch: [ "amd64", "386" ]
    runs-on: ubuntu-latest
    steps:
    - name: Install Go
      uses: actions/setup-go@v1
      with:
        go-version: ${{ matrix.go-version }}
      env:
        GOARCH: ${{ matrix.goarch }}
    - name: Checkout code
      uses: actions/checkout@v2
    - uses: actions/cache@v1
      with:
          path: ~/go/pkg/mod
          key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
          restore-keys: |
              ${{ runner.os }}-go-
    - name: Test
      env:
        GOARCH: ${{ matrix.goarch }}
      run: go test ./...