Skip to content

refactor: built in openapi generator #219

refactor: built in openapi generator

refactor: built in openapi generator #219

Workflow file for this run

# .github/workflows/ci.yml
name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CACHE_VERSION: v1 # Increment to bust cache when needed
jobs:
# ========================================
# Quality Gate
# ========================================
quality:
name: 🛡️ Quality Gate
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: 📥 Checkout
uses: actions/checkout@v4
- name: 🐹 Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.25.x' # Use latest supported toolchain for quality checks
check-latest: true # Always grab the newest patch release
cache: true # Handles ~/.cache/go-build and ~/go/pkg/mod
- name: 📁 Cache Tools
uses: actions/cache@v4
with:
path: |
~/.cache/golangci-lint
~/go/bin
key: ${{ runner.os }}-tools-${{ env.CACHE_VERSION }}-${{ hashFiles('tools/tools.go', 'Makefile') }}
restore-keys: |
${{ runner.os }}-tools-${{ env.CACHE_VERSION }}-
${{ runner.os }}-tools-
- name: 🔧 Install Tools
run: make install-tools
- name: ✅ Run Quality Checks
run: make check
# ========================================
# Test Matrix
# ========================================
test:
name: 🧪 Test Matrix
runs-on: ${{ matrix.os }}
timeout-minutes: 15
needs: quality
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
go-version: ['1.23', '1.24', '1.25']
steps:
- name: 📥 Checkout
uses: actions/checkout@v4
- name: 🐹 Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
check-latest: true
cache: true # Handles module/build cache
- name: 🧪 Run Tests
run: make test
- name: 📊 Generate Coverage Report
if: matrix.go-version == '1.23'
run: make testcov
- name: 📈 Upload Coverage Report
if: matrix.go-version == '1.23'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/coverage.out
fail_ci_if_error: false
verbose: true
# ========================================
# Final Status Check
# ========================================
ci-success:
name: ✅ CI Success
runs-on: ubuntu-latest
needs: [quality, test]
if: always()
steps:
- name: Check all jobs status
run: |
if [[ "${{ needs.quality.result }}" != "success" ]]; then
echo "Quality gate failed"
exit 1
fi
if [[ "${{ needs.test.result }}" != "success" ]]; then
echo "Tests failed"
exit 1
fi
echo "All CI checks passed! 🎉"