Skip to content

fix executable call #54

fix executable call

fix executable call #54

Workflow file for this run

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('uncord-bot-go/go.sum') }}
restore-keys: |
go-mod-
# Step 4: Install dependencies
- name: Install dependencies
working-directory: uncord-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: |
./uncord-bot-go
key: go-build-${{ hashFiles('uncord-bot-go/go.sum', 'uncord-bot-go/**/*.go') }}-${{ runner.os }}-build
restore-keys: |
go-build-${{ runner.os }}-build
# Step 6: Build the application
- name: Build
working-directory: uncord-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: uncord-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: uncord-bot-go/coverage.out
# Step 9: Run go vet for static analysis
- name: Run go vet
working-directory: uncord-bot-go
run: go vet ./...
# Step 10: Install golint for linting
- name: Install golint
working-directory: uncord-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: uncord-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