chore: reduce CI cron from daily to weekly #419
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 🏁 Championship CI/CD | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main ] | |
| env: | |
| NODE_VERSION: '20.x' | |
| jobs: | |
| # 🔒 Security Check | |
| security: | |
| name: 🔒 Security Audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: NPM Audit | |
| run: npm audit --audit-level=moderate --omit=dev | |
| - name: Check for secrets | |
| uses: trufflesecurity/trufflehog@c563a0692fa2017ff949d219cc9f586293d41e66 | |
| with: | |
| path: ./ | |
| base: ${{ github.event.repository.default_branch }} | |
| # 🧪 Test Suite | |
| test: | |
| name: 🧪 Test Suite | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| node: [18.x, 20.x, 22.x] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Node.js ${{ matrix.node }} | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Lint code | |
| run: npm run lint | |
| - name: Build TypeScript | |
| run: npm run build | |
| - name: Run tests | |
| run: npm test -- --coverage | |
| - name: Test CLI functionality | |
| run: | | |
| node dist/cli.js --help | |
| node dist/cli.js --version | |
| - name: Test project detection | |
| shell: bash | |
| run: | | |
| node dist/cli.js init --force --output test.faf | |
| ls -la test.faf | |
| head -10 test.faf | |
| node dist/cli.js score test.faf | |
| node dist/cli.js validate test.faf | |
| - name: Upload coverage | |
| if: matrix.os == 'ubuntu-latest' && matrix.node == '20.x' | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: ./coverage/lcov.info | |
| flags: unittests | |
| name: codecov-umbrella | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v6 | |
| if: matrix.os == 'ubuntu-latest' && matrix.node == '20.x' | |
| with: | |
| name: dist-files | |
| path: dist/ | |
| # 💎 Code Quality | |
| quality: | |
| name: 💎 Code Quality | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Lint | |
| run: npm run lint | |
| - name: Format Check | |
| run: npm run format -- --check | |
| continue-on-error: true | |
| # ⚡ Performance | |
| performance: | |
| name: ⚡ Performance Check | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Run performance validation | |
| run: npm run performance:ci | |
| # 🏎️ TAF - Testing Activity Feed | |
| taf: | |
| name: 🏎️ TAF Receipt | |
| runs-on: ubuntu-latest | |
| needs: test | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Run Tests and Capture Output | |
| run: npm test 2>&1 | tee /tmp/test-output.txt | |
| - name: Generate TAF Receipt | |
| uses: Wolfe-Jam/faf-taf-git@v2.1.0 | |
| with: | |
| test-output-file: /tmp/test-output.txt | |
| auto-commit: 'true' | |
| commit-message: 'chore(taf): update .taf receipt [skip ci]' | |
| target-branch: taf-receipts | |
| # 🏆 Championship Status | |
| status: | |
| name: 🏆 Championship Status | |
| runs-on: ubuntu-latest | |
| needs: [security, test, quality, performance] | |
| if: always() | |
| steps: | |
| - name: Check results | |
| run: | | |
| echo "🏁 FAF CLI Championship CI/CD" | |
| echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" | |
| failed=0 | |
| if [ "${{ needs.security.result }}" != "success" ]; then | |
| echo "❌ Security: ${{ needs.security.result }}" | |
| failed=1 | |
| else | |
| echo "✅ Security: passed" | |
| fi | |
| if [ "${{ needs.test.result }}" != "success" ]; then | |
| echo "❌ Tests: ${{ needs.test.result }}" | |
| failed=1 | |
| else | |
| echo "✅ Tests: all platforms" | |
| fi | |
| if [ "${{ needs.quality.result }}" != "success" ]; then | |
| echo "❌ Quality: ${{ needs.quality.result }}" | |
| failed=1 | |
| else | |
| echo "✅ Quality: passed" | |
| fi | |
| if [ "${{ needs.performance.result }}" != "success" ]; then | |
| echo "⚠️ Performance: ${{ needs.performance.result }}" | |
| else | |
| echo "✅ Performance: passed" | |
| fi | |
| echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" | |
| if [ "$failed" -eq 1 ]; then | |
| echo "🚨 CI FAILED — check above" | |
| exit 1 | |
| fi | |
| echo "🏆 PODIUM READY!" |