Skip to content

Commit

Permalink
Switch to GH workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Koch <[email protected]>
  • Loading branch information
hugelgupf committed Feb 7, 2024
1 parent c9ad5dc commit a10c522
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 54 deletions.
54 changes: 0 additions & 54 deletions .circleci/config.yml

This file was deleted.

79 changes: 79 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Go

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

# Cancel running workflows on new push to a PR.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
tidy:
name: Tidy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
go-version: '1.22.x'
- name: gofmt
command: |
test -z "$(gofmt -s -l $(find -name '*.go'))"
- name: go mod tidy
command: |
go mod tidy
git status
if [[ -n "$(git status --porcelain .)" ]]; then
echo 'go.mod/go.sum is out-of-date: run `go mod tidy` and then check in the changes'
echo 'If `go mod tidy` results in no changes, make sure you are using the latest relase of Go'
git status --porcelain .
exit 1
fi
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
goversion: ['1.21.x', '1.22.x']
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.goversion }}

- run: go build -v ./...

- run: ./cross-compile.sh

test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
goversion: ['1.21.x', '1.22.x']
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.goversion }}

- name: Test
run: go test -v -covermode atomic -coverpkg ./... -coverprofile cover.out ./...

- name: Race
run: go test -race -v ./...

- uses: codecov/codecov-action@v4-beta
env:
CODECOV_TOKEN: '9f38c23a-5d79-4a19-a90f-72edcac95ce1'
with:
flags: ${{ matrix.goversion }}
fail_ci_if_error: true
verbose: true

0 comments on commit a10c522

Please sign in to comment.