From 2f445fa4ae77873f96a6215bdce945f3d1de34ad Mon Sep 17 00:00:00 2001 From: Nicolas Peugnet Date: Mon, 16 Feb 2026 14:57:14 +0100 Subject: [PATCH] Add basic Github action workflow to run checks The tests of this library currently do not pass. It seems upstream developpers didn't care to run the testsuite after making changes, leading to a lot of tests failing. To prevent this situation, it is good to run the build and tests on each push and pull requests to master. This commits adds a very basic GitHub actions workflow for go projects. The composites check of go vet is ignored as the tests make a heavy use of unkeyed struct fields, which leaded to a lot of "struct literal uses unkeyed fields" warnings that are not that important since the package comes from the same repository. --- .github/workflows/build.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..c5950f1 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,32 @@ +name: build + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version: '1.21' + + - name: Build + run: go build -v ./... + + - name: Test + run: go test -v -cover ./... + + - name: Lint + run: go vet -composites=false ./... + + - name: Format + run: go fmt ./... && git diff --exit-code --color