From 2707072461f260827dc7df270db3f2aa007d42e3 Mon Sep 17 00:00:00 2001 From: Jason Roelofs Date: Thu, 21 Mar 2024 16:26:45 -0400 Subject: [PATCH] Add GitHub Actions as the CI runner We are working on consolidating all CI to GitHub Actions. Given the nature of `go`, the `setup-go` action supports `stable` and `oldstable` which ensure this will always build against the 2 most recent major versions of the language. --- .github/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..842e2482 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,36 @@ +name: CI + +on: + push: + branches: + - 'main' + pull_request: {} + +defaults: + run: + shell: bash + +jobs: + test: + name: Test Go ${{ matrix.go }} + runs-on: ubuntu-latest + strategy: + matrix: + go: + - 'stable' + - 'oldstable' + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go }} + + - name: Run Tests + run: | + go mod download + go test -v ./... + + - name: Code style + run: | + gofmt -d ./ + git diff --exit-code