Skip to content

Installation

This guide walks you through adding Go Gamma Actions to your project.

Prerequisites

Before you begin, ensure you have:

  • A Go project with a go.mod file
  • GitHub Actions enabled on your repository
  • (Optional) A Codecov account for coverage tracking

Step 1: Create Workflow File

Create a new file at .github/workflows/ci.yml in your repository:

name: CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  ci:
    uses: go-gamma/actions/.github/workflows/ci.yml@v1
    with:
      go-version: '1.24'
    secrets:
      CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Step 2: Configure Secrets (Optional)

For Codecov integration, add your Codecov token:

  1. Go to your repository Settings > Secrets and variables > Actions
  2. Click New repository secret
  3. Name: CODECOV_TOKEN
  4. Value: Your Codecov upload token

Organization Secrets

If you're using Go Gamma Actions across multiple repositories, consider adding CODECOV_TOKEN as an organization secret.

Step 3: Enable Security Scanning (Optional)

For GitHub Code Scanning integration, add permissions:

jobs:
  ci:
    uses: go-gamma/actions/.github/workflows/ci.yml@v1
    permissions:
      contents: read
      security-events: write  # Required for SARIF upload
    with:
      go-version: '1.24'
      upload-sarif: true

Step 4: Commit and Push

git add .github/workflows/ci.yml
git commit -m "Add CI workflow"
git push

Verification

After pushing, check the Actions tab in your repository. You should see:

  • ✅ Tests running with race detection
  • ✅ Linting with 50+ rules
  • ✅ Security scanning
  • ✅ Cross-platform builds

Next Steps