diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index c2ebfd7..0000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,34 +0,0 @@ -name: CI - -on: - push: - branches: [master] - pull_request: - -jobs: - build: - name: Build - runs-on: ${{ matrix.os }} - - strategy: - # Fail fast is disabled because there are Go version specific features and tests - # that should be able to fail independently. - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest] - go-version: ['1.16', '1.17', '1.18', '1.19', '1.20'] - - steps: - - name: Checkout repository - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - - - name: Set up Go - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 - with: - go-version: ${{ matrix.go }} - - - name: Build - run: go build -v ./... - - - name: Test - run: go test -race -v ./... diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..1755fb8 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,39 @@ +on: + push: + branches: [main] + pull_request: +name: Test +permissions: + contents: read +jobs: + test: + strategy: + matrix: + go-version: [1.19.x, 1.20.x, 1.21.x] + platform: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.platform }} + steps: + - name: Install Go + uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go-version }} + - name: Install staticcheck + if: matrix.go-version == '1.21.x' + run: go install honnef.co/go/tools/cmd/staticcheck@latest + shell: bash + - name: Update PATH + run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH + shell: bash + - name: Checkout code + uses: actions/checkout@v3 + - name: Fmt + if: matrix.platform != 'windows-latest' # :( + run: "diff <(gofmt -d .) <(printf '')" + shell: bash + - name: Vet + run: go vet ./... + - name: Staticcheck + if: matrix.go-version == '1.21.x' + run: staticcheck ./... + - name: Test + run: go test -race ./...