[change gitignore to default to ignore] #94
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#name: CI | |
# | |
#on: | |
# push: | |
# branches: [main] | |
# pull_request: | |
# branches: [main] | |
# | |
#jobs: | |
# CI: | |
# runs-on: ubuntu-20.04 | |
# | |
# steps: | |
# | |
# # Step 1: Checkout the code | |
# - uses: actions/checkout@v2 | |
# | |
# # Step 2: Set up Go environment | |
# - name: Set up Go | |
# uses: actions/setup-go@v2 | |
# with: | |
# go-version: 1.23 | |
# | |
# # Step 3: Cache Go modules (dependencies) | |
# - name: Cache Go modules | |
# id: cache-go-modules | |
# uses: actions/cache@v2 | |
# with: | |
# path: | | |
# ~/.cache/go-build | |
# /go/pkg/mod | |
# key: go-mod-${{ hashFiles('unccord-bot-go/go.sum') }} | |
# restore-keys: | | |
# go-mod- | |
# | |
# # Step 4: Install dependencies | |
# - name: Install dependencies | |
# working-directory: unccord-bot-go | |
# run: go mod tidy && go mod verify | |
# if: steps.cache-go-modules.outputs.cache-hit != 'true' # Only run if cache is not found | |
# | |
# # Step 5: Cache Go build (object cache) | |
# - name: Cache Go build | |
# uses: actions/cache@v2 | |
# with: | |
# path: | | |
# ./unccord-bot-go | |
# key: go-build-${{ hashFiles('unccord-bot-go/go.sum', 'unccord-bot-go/**/*.go') }}-${{ runner.os }}-build | |
# restore-keys: | | |
# go-build-${{ runner.os }}-build | |
# | |
# # Step 6: Build the application | |
# - name: Build | |
# working-directory: unccord-bot-go | |
# run: go build ./cmd/main.go | |
# | |
# # Step 7: Run unit tests with race detection and generate coverage report | |
# - name: Run unit tests with coverage | |
# working-directory: unccord-bot-go | |
# run: go test -race -coverprofile=coverage.out ./... | |
# | |
# # Step 8: Upload test coverage report (optional, useful if using a coverage service) | |
# - name: Upload test coverage report | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: coverage-report | |
# path: unccord-bot-go/coverage.out | |
# | |
# # Step 9: Run go vet for static analysis | |
# - name: Run go vet | |
# working-directory: unccord-bot-go | |
# run: go vet ./... | |
# | |
# # Step 10: Install golint for linting | |
# - name: Install golint | |
# working-directory: unccord-bot-go | |
# run: go install golang.org/x/lint/golint@latest | |
# | |
# # Step 11: Run golint to check for code quality issues | |
# - name: Run golint | |
# working-directory: unccord-bot-go | |
# run: golint ./... | |
# | |
# # Step 12: Post PR summary comment (Optional) | |
# # - name: Post PR summary | |
# | |
# # Step 13: Add label to PR | |
# # - name: Add label to PR |