diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index b9c7c4d..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,45 +0,0 @@ -# Golang CircleCI 2.0 configuration file -# -# Check https://circleci.com/docs/2.0/language-go/ for more details -version: 2 -jobs: - golangci-lint: - docker: - - image: circleci/golang:latest - steps: - - checkout - - run: - # https://golangci-lint.run/usage/install/ - name: Install golangci-lint - # Note: It's likely the below URL's "master" will change to "main" someday. - # The version of golangci-lint being used can be changed with the vN.N.N at the end of this URL. - command: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ~/bin v1.42.0 - - - run: - name: Run Go Linters - command: ~/bin/golangci-lint run . --timeout 2m - - go-build-and-test: - machine: - image: ubuntu-2004:202107-02 - steps: - - checkout - - run: - name: Fetch Dependencies - command: go get -t . - - run: - name: Execute Go Build - command: go build . - - run: - name: Execute Go Tests - command: go test -race -coverprofile=coverage.txt -covermode=atomic - - run: - name: Upload Code Coverage - command: bash <(curl -s https://codecov.io/bash) - -workflows: - version: 2 - build: - jobs: - - golangci-lint - - go-build-and-test diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..5ee2260 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,50 @@ +name: CI + +on: + push: + branches: [master, main] + pull_request: + branches: [master, main] + +jobs: + golangci-lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + version: v1.42.0 + args: --timeout 2m + + go-build-and-test: + name: Build & Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + + - name: Fetch Dependencies + run: go get -t . + + - name: Build + run: go build . + + - name: Test + run: go test -race -coverprofile=coverage.txt -covermode=atomic + + - name: Upload Coverage to Codecov + uses: codecov/codecov-action@v4 + with: + files: coverage.txt + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}