From a3b1ca1b26efd7162dc71a3f750d621ffee893e0 Mon Sep 17 00:00:00 2001 From: lightchainaidev Date: Mon, 12 Oct 2026 15:21:13 +0200 Subject: [PATCH] ci: build, lint and test every pull request Pull requests run go build, golangci-lint on the lines they change and go test. --- .github/workflows/ci.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 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 0000000..76d7442 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,33 @@ +# Every pull request: build, lint and test the shared package. +name: CI + +on: + pull_request: + +permissions: + contents: read + +jobs: + check: + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + # Two commits deep, so the lint step can compare with the commit before this one. + - uses: actions/checkout@v7 + with: + fetch-depth: 2 + persist-credentials: false + + - uses: actions/setup-go@v7 + with: + go-version-file: go.mod + + - run: go build ./... + + # New issues only: those on lines changed since the previous commit, which for a pull request is the branch it + # merges into. The findings the code already had do not fail the check. + - uses: golangci/golangci-lint-action@v9 + with: + args: --new-from-rev=HEAD~ + + - run: go test ./...