GitHub Actions provides continuous integration and deployment automation. This guide helps you set up workflows based on your project's requirements.
-
Create Workflow Directory
mkdir -p .github/workflows
-
Choose Your Workflows Select from the available templates based on your project needs:
- Required: Test suite for all projects
- Recommended: Coverage reporting and linting
- Optional: Benchmarks, releases, documentation
-
Copy and Customize Templates Copy the relevant templates from
templates/cicd/workflows/and customize for your project.
- Test Suite: Run tests across Python versions
- Template:
github-actions-test.yaml - Purpose: Ensure code works on supported platforms
- Template:
- Coverage: Track test coverage metrics
- Template:
github-actions-coverage.yaml - Purpose: Maintain code quality standards
- Template:
- Linting: Automated code quality checks
- Template:
github-actions-lint.yaml - Purpose: Enforce coding standards
- Template:
- Benchmarks: Performance testing
- Release: PyPI publishing automation
- Documentation: Auto-generate docs
- Test Suite: github-actions-test.yaml
- Coverage: github-actions-coverage.yaml
- Benchmarks: github-actions-benchmark.yaml
- Linting: github-actions-lint.yaml
- Security: github-actions-security.yaml
- Dependencies: github-actions-deps.yaml
- PyPI Release: github-actions-release.yaml
- GitHub Release: github-actions-gh-release.yaml
- Documentation: github-actions-docs.yaml
Decide which workflows you need:
- Minimum: Test suite (
github-actions-test.yaml) - Recommended: Add coverage and linting
- Full CI/CD: Include all relevant workflows
# Copy test workflow (required)
cp templates/cicd/workflows/github-actions-test.yaml .github/workflows/test.yml
# Copy coverage workflow (recommended)
cp templates/cicd/workflows/github-actions-coverage.yaml .github/workflows/coverage.yml
# Copy other workflows as neededReplace placeholders in your workflow files:
{package_name}→ Your package name{python_version}→ Your Python version(s)- Update branch names in triggers
- Adjust matrix strategy for your needs
For workflows requiring secrets:
- Go to Settings → Secrets → Actions
- Add required secrets (e.g.,
PYPI_API_TOKENfor releases)
# On push to specific branches
on:
push:
branches: [main, develop]
# On pull request
on:
pull_request:
branches: [main]
# On release
on:
release:
types: [published]
# On schedule
on:
schedule:
- cron: '0 0 * * 0' # Weekly
# Manual trigger
on:
workflow_dispatch:Most Python workflows should use uv for package management:
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Install dependencies
run: uv sync --dev
- name: Run tests
run: uv run pytestTest across multiple environments:
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11']
os: [ubuntu-latest, macos-latest]Speed up workflow runs:
- uses: actions/cache@v3
with:
path: ~/.cache/uv
key: uv-${{ hashFiles('**/uv.lock') }}Prevent duplicate runs:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: truePrevent hanging workflows:
jobs:
test:
timeout-minutes: 30Add badges to your README to show workflow status:


Replace {username} and {repo} with your GitHub details.
Workflow not triggering
- Check branch names in triggers
- Verify file location (
.github/workflows/) - Ensure YAML syntax is valid
Permission errors
permissions:
contents: read
pull-requests: writeSecret not found
- Verify secret name matches exactly
- Check secret is set in repository settings
- Ensure secret scope (repository/organization)
- Source: vibe-coding-templates
- Version: 1.0.0
- Date: 2025-08-19
- Author: chrishayuk
- Template: Generic Python Project
When using this guide:
- Start with the test workflow (required for all projects)
- Add additional workflows based on project needs
- Customize templates for your specific requirements
- Set up secrets before running workflows that need them
- Test workflows on feature branches first