From 3820929df1cba91c92198c1a1b5ad128fc8b9fcf Mon Sep 17 00:00:00 2001 From: Jan Pieper Date: Thu, 31 Jul 2025 14:36:30 +0200 Subject: [PATCH] feat: add GitHub workflow for pull requests --- .github/workflows/pull_request.yaml | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/pull_request.yaml diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml new file mode 100644 index 0000000..bcd5a02 --- /dev/null +++ b/.github/workflows/pull_request.yaml @@ -0,0 +1,44 @@ +name: Pull Request + +on: + pull_request: + +jobs: + check-go: + name: Ensure Go modules synchronicity + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Setup Golang + uses: actions/setup-go@v5 + with: + go-version: 1.24.x + cache: false + - name: Download all Go modules + run: | + go mod download + - name: Check for tidiness of go.mod and go.sum + run: | + go mod tidy + git diff --exit-code -- . + + lint-go: + name: Lint Go code + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Setup Golang + uses: actions/setup-go@v5 + with: + go-version: 1.24.x + cache: false + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v8 + with: + version: v2.3.0 + args: --verbose