A production-ready collection of reusable composite GitHub Actions for Zondax projects, designed for enterprise-scale CI/CD workflows with comprehensive security, testing, and performance optimization.
# In your workflow file (.github/workflows/ci.yml)
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout with App Auth
uses: zondax/checkout-with-app@v1
with:
github_app_auth: true
app_id: ${{ secrets.APP_ID }}
app_pem: ${{ secrets.APP_PEM }}
- name: Setup Node.js
uses: zondax/setup-node-env@v1
with:
node_version: '20'
package_manager: 'pnpm'
- name: Setup Ubuntu Packages
uses: zondax/setup-ubuntu-packages@v1
with:
packages: "build-essential cmake pkg-config libssl-dev"
Checkout repository with optional GitHub App authentication and git configuration.
Usage:
- uses: zondax/checkout-with-app@v1
with:
github_app_auth: true
github_app_repos: |
owner/repo1
owner/repo2
app_id: ${{ secrets.APP_ID }}
app_pem: ${{ secrets.APP_PEM }}
Inputs:
github_app_auth
: Use GitHub App Token (default: false)github_app_repos
: Additional repositories to access (one per line)checkout_submodules
: Checkout submodules (default: true)fetch_depth
: Number of commits to fetch. 0 fetches all history (default: 0)ref
: The branch, tag or SHA to checkoutuse_sudo
: Use sudo for git config command (default: false)patch_git_config
: Add safe.directory to git config (default: true)app_id
: GitHub App IDapp_pem
: GitHub App PEM
Setup Node.js with package manager (npm, yarn, pnpm, or bun) and install dependencies.
Usage:
- uses: zondax/setup-node-env@v1
with:
node_version: '20'
package_manager: 'pnpm'
package_manager_version: '8.0.0'
autoinit_env: true
Inputs:
node_version
: Node.js version to install (default: lts/*)package_manager
: Package manager to use - npm, yarn, pnpm, or bun (default: npm)package_manager_version
: Package manager version (default: latest)install_deps
: Install dependencies after setup (default: true)working_directory
: Working directory for package operations (default: .)cache_dependencies
: Cache dependencies (default: true)autoinit_env
: Run env:init:ci script after installing dependencies (default: false)
Outputs:
pm
: Package manager command (e.g., 'pnpm')pm_run
: Package manager run command (e.g., 'pnpm run')cache_hit
: Whether the cache was hit
Configure Ubuntu mirrors and install packages for faster, reliable CI builds.
Usage:
- uses: zondax/setup-ubuntu-packages@v1
with:
packages: |
- git
- curl
- build-essential
- pkg-config
- libssl-dev
extra_packages: |
- jq
- unzip
Inputs:
packages
: List of packages to install as YAML list or space-separated string (default: git, curl)extra_packages
: Additional packages to install as YAML list or space-separated string (default: '')
Advanced Inputs (optional):
update_cache
: Run apt-get update before package installation (default: true)ubuntu_version
: Ubuntu version codename, auto-detected if empty (default: '')retry_count
: Number of retry attempts for package installation (default: 3)cache_timeout
: Timeout in seconds for package operations (default: 300)
Note: Mirror configuration is handled automatically using fast mirrors (Init7) with fallback to official Ubuntu repositories.
Outputs:
mirror_configured
: Whether mirrors were configured successfullypackages_installed
: List of successfully installed packagesubuntu_codename
: Detected Ubuntu codename
Authenticate with Google Cloud using Workload Identity Federation with optional JWT debugging.
Usage:
- uses: zondax/gcp-wif-auth@v1
with:
workload_identity_provider: ${{ vars.PULUMI_DEPLOY_WIF_PROVIDER }}
project_id: ${{ vars.PULUMI_GCP_PROJECT_ID }}
log_jwt_info: true
Inputs:
workload_identity_provider
: Workload Identity Provider resource name (required)project_id
: GCP Project IDservice_account
: Service account email to impersonateaudience
: Audience for the OIDC tokensetup_gcloud
: Install and configure gcloud SDK (default: true)gcloud_version
: Version of gcloud SDK to install (default: latest)gcloud_components
: Additional gcloud components to install (comma-separated)log_jwt_info
: Log JWT token information for debugging (default: true)verify_authentication
: Verify authentication by running gcloud commands (default: true)export_credentials
: Export credentials to environment (default: true)
Outputs:
credentials_path
: Path to the generated credentials fileaccess_token
: Access token for authenticated requestsproject_id
: GCP Project ID
- β Comprehensive Testing: Automated CI/CD with matrix testing across multiple environments
- β Security First: CodeQL analysis, secret scanning, dependency vulnerability checks
- β Performance Optimized: Swiss mirror optimization, fast-path/slow-path execution
- β Semantic Versioning: Automated releases with conventional commits
- β Monitoring: Performance benchmarking and health checks
- β Documentation: Comprehensive docs with troubleshooting guides
All actions are optimized for Zondax's Swiss infrastructure:
- π¨π Init7 Primary Mirror: Ultra-fast package downloads in Switzerland
- π« ETH Zurich Fallback: Academic network reliability
- π Global CDN Fallbacks: Worldwide availability
name: Zondax Enterprise CI/CD
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
setup:
runs-on: ubuntu-latest
outputs:
node-version: ${{ steps.setup.outputs.node-version }}
package-manager: ${{ steps.setup.outputs.pm }}
steps:
- name: Enterprise Checkout
uses: zondax/checkout-with-app@v1
with:
github_app_auth: true
github_app_repos: |
zondax/private-repo-1
zondax/private-repo-2
app_id: ${{ secrets.ZONDAX_APP_ID }}
app_pem: ${{ secrets.ZONDAX_APP_PEM }}
checkout_submodules: true
- name: Setup Development Environment
id: setup
uses: zondax/setup-node-env@v1
with:
node_version: '20'
package_manager: 'pnpm'
cache_dependencies: true
autoinit_env: true
- name: Install System Dependencies
uses: zondax/setup-ubuntu-packages@v1
with:
packages: |
build-essential
cmake
pkg-config
libssl-dev
libudev-dev
extra_packages: "jq tree htop"
enable_mirrors: true
security:
runs-on: ubuntu-latest
needs: setup
steps:
- name: Check Repository Health
uses: zondax/check-large-files@v1
with:
max_size: "50MB"
fail_on_large_files: true
deploy:
runs-on: ubuntu-latest
needs: [setup, security]
if: github.ref == 'refs/heads/main'
steps:
- name: Authenticate with GCP
uses: zondax/gcp-wif-auth@v1
with:
workload_identity_provider: ${{ vars.GCP_WIF_PROVIDER }}
project_id: ${{ vars.GCP_PROJECT_ID }}
service_account: ${{ vars.GCP_SERVICE_ACCOUNT }}
log_jwt_info: false
# Clone and setup development environment
git clone https://github.com/zondax/zondax-actions.git
cd zondax-actions
# Run automated setup
./scripts/dev-setup.sh
# Validate your changes
./scripts/validate-actions.sh
./scripts/security-check.sh
./scripts/test-all.sh
- Read CONTRIBUTING.md for detailed guidelines
- Follow security best practices - all PRs are security scanned
- Add comprehensive tests - 100% test coverage required
- Update documentation - include usage examples
- Use conventional commits - enables automatic releases
# Validate all actions
./scripts/validate-actions.sh
# Run security checks
./scripts/security-check.sh
# Check for large files
./scripts/check-large-files.sh
# Run comprehensive tests
./scripts/test-all.sh
- β‘ Average execution time: < 2 minutes for typical workflows
- π Swiss mirror performance: ~10x faster than default mirrors
- π Cache hit ratio: > 90% for dependencies
- π Success rate: > 99.5% across all actions
All actions include built-in monitoring:
- Performance benchmarking in CI/CD
- Error tracking and reporting
- Usage analytics (anonymous)
- Health checks and alerts
- π‘οΈ CodeQL Analysis: Automated security scanning
- π Secret Scanning: TruffleHog integration
- π¦ Dependency Scanning: Trivy vulnerability detection
- π Shell Security: ShellCheck and custom rules
- π·οΈ Supply Chain: Action dependency verification
- β SOC 2 Compatible: Audit trail and access controls
- β GDPR Compliant: No personal data collection
- β Enterprise Ready: Supports corporate proxies and air-gapped environments
- Major versions (v1, v2): Breaking changes, manual upgrade required
- Minor versions (v1.1.0): New features, backward compatible
- Patch versions (v1.1.1): Bug fixes, security updates
# β
Recommended: Use major version for automatic updates
- uses: zondax/action-name@v1
# β
Conservative: Pin to specific version
- uses: zondax/[email protected]
# β Not recommended: Use main branch
- uses: zondax/action-name@main
- π Documentation: Comprehensive guides for each action
- π Bug Reports: Open an issue
- π‘ Feature Requests: Discussion forum
- π Security Issues: [email protected]
Issue | Solution |
---|---|
Slow package installation | Enable mirrors with enable_mirrors: true |
Authentication failures | Verify GitHub App permissions |
Large file warnings | Use Git LFS or add to .gitignore |
Node.js version conflicts | Pin version with node_version: 'X.Y.Z' |
# Enable verbose logging for debugging
- uses: zondax/setup-ubuntu-packages@v1
with:
packages: "build-essential"
enable_mirrors: true
verbose: true # π Enables detailed logging
Apache License 2.0 - See LICENSE for details.