diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..b38d26d --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,21 @@ +version: 2 +jobs: + go1.23: &base + docker: + - image: cimg/go:1.23 + steps: + - run: go version + - checkout + - run: go test -race -v ./... + + go1.22: + <<: *base + docker: + - image: cimg/go:1.22 + +workflows: + version: 2 + build: + jobs: + - go1.23 + - go1.22 diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..5c715a6 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,48 @@ +name: Go + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + test: + strategy: + matrix: + os: ["ubuntu-latest", "macos-latest", "windows-latest"] + go-ver: ["1.23", "1.22"] + include: + - os: "ubuntu-latest" + go-ver: "1.23" + cover: true + + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go-ver }} + + - name: Build + run: go build -v ./... + + - name: Test without Cover + run: go test -v ./... + if: ${{ !matrix.cover }} + + - name: Test with Cover + run: go test -v -coverprofile=coverage.txt -covermode=atomic ./... + if: ${{ matrix.cover }} + + - name: Test Race + run: go test -race -v ./... + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4 + if: ${{ matrix.cover }} + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} +