From 92515de15a8b9a6d55d71c3b6297fa26165886a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=B1=E5=B4=8E=E3=83=92=E3=82=AB=E3=83=AB?= Date: Thu, 13 Mar 2025 15:41:24 +0800 Subject: [PATCH] chore(ci): Add GitHub Actions workflow for build & test automation - Added `.github/workflows/go.yml` for CI/CD integration. - Runs build & test steps on push and pull requests to `master`. - Uses `golangci-lint` for linting and `go test` for coverage reports. - Uploads test coverage to Codecov for analysis. - Future improvement: Add release automation. --- .github/workflows/go.yml | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/go.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..80c8e1d --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,43 @@ +# GitHub Actions workflow for go-tetris +name: Go + +on: + push: + branches: + - "master" + - "feature/**" + - "fix/**" + pull_request: + branches: + - "master" + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.24.1' # Updated to Go 1.24.1 + + - name: Verify go.mod and go.sum + run: go mod tidy && git diff --exit-code go.mod go.sum + + - name: Run Linter + uses: golangci/golangci-lint-action@v3 + with: + version: latest + + - name: Build + run: go build -v ./... + + deploy: + if: github.ref == 'refs/heads/master' + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to Production + run: echo "Deploying application..."