name: Test on: push: branches: - main pull_request: branches: - main jobs: unit: runs-on: ubuntu-latest strategy: matrix: go-version: [1.12.x, 1.13.x, 1.14.x, 1.15.x, 1.16.x] steps: - name: Checkout uses: actions/checkout@v2 - name: Cache dependencies uses: actions/cache@v2 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- - name: Setup Go uses: actions/setup-go@v2 with: go-version: ${{ matrix.go-version }} - name: Run tests run: go test -v ./...