diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..889b63e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,74 @@ +name: Build + +on: + push: + branches: + - develop + - master + pull_request: + +jobs: + + go-legacy-test: + runs-on: ubuntu-latest + strategy: + matrix: + go-version: [ '1.20', '1.21' ] + steps: + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go-version }} + - name: Go get + run: go get -t ./... + - name: Build + run: go build -v ./... + - name: Test + run: go test -v ./... + + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.22.4' + - name: Go get + run: go get -t ./... + - name: Build + run: go build -v ./... + - name: Test + run: go test -v -covermode=atomic -coverprofile=cover.out -coverpkg=. ./... + - name: Install goveralls + run: go install github.com/mattn/goveralls@latest + - name: Send coverage + env: + COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: goveralls -coverprofile=cover.out -service=github + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.22.4' + - name: Install checks + run: | + go install honnef.co/go/tools/cmd/staticcheck@latest + go install github.com/client9/misspell/cmd/misspell@latest + - name: Go get + run: go get -t ./... + - name: Go vet + run: go vet $(go list ./... | grep -v /vendor/) + - name: Go mod + run: go mod tidy; git diff --exit-code go.mod go.sum + - name: Go fmt + run: go fmt $(go list ./... | grep -v /vendor/); git diff --exit-code + - name: Staticcheck + run: staticcheck -checks all,-ST1000 ./... + - name: Misspell + run: misspell -error -locale US . diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f6e813d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: Release + +on: + push: + tags: + - '*' + +# Make sure the GITHUB_TOKEN has permission to upload to our releases +permissions: + contents: write + +jobs: + + create_release: + name: Create Release + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v4 + - name: Create release draft + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref_name }} + body: | + A new release + draft: true + prerelease: false diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 659ecf5..0000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: go -go: -- 1.16.x -- 1.15.x -- 1.14.x -install: -- go get -t ./... -- if [[ "$TRAVIS_GO_VERSION" =~ ^1\.16\. ]]; then ./scripts/install-checks.sh; fi -before_script: -- if [[ "$TRAVIS_GO_VERSION" =~ ^1\.16\. ]]; then ./scripts/check.sh; fi -- go build -- go build $(go list ./examples/...) -script: -- if [[ "$TRAVIS_GO_VERSION" =~ ^1\.16\. ]]; then ./scripts/cover.sh TRAVIS; else go test -i -race ./...; fi diff --git a/README.md b/README.md index 9314ed1..5c7e30a 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@