Delete cf-webapp-quality-gates.yml (consolidated into ci.yaml)
This commit is contained in:
parent
2ae7c7aa2d
commit
ccd2ee27ff
1 changed files with 0 additions and 170 deletions
170
.github/workflows/cf-webapp-quality-gates.yml
vendored
170
.github/workflows/cf-webapp-quality-gates.yml
vendored
|
|
@ -1,170 +0,0 @@
|
|||
name: cf-webapp Quality Gates
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- "js/cf-webapp/**"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
pull-requests: write
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
check-changes:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
should-run: ${{ steps.filter.outputs.webapp }}
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: dorny/paths-filter@v4
|
||||
id: filter
|
||||
with:
|
||||
filters: |
|
||||
webapp:
|
||||
- 'js/cf-webapp/**'
|
||||
|
||||
skip:
|
||||
needs: check-changes
|
||||
if: needs.check-changes.outputs.should-run != 'true'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: echo "No cf-webapp changes, skipping."
|
||||
|
||||
benchmark:
|
||||
needs: check-changes
|
||||
if: needs.check-changes.outputs.should-run == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: "20"
|
||||
registry-url: https://npm.pkg.github.com
|
||||
scope: "@codeflash-ai"
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10
|
||||
|
||||
- name: Restore WASM artifacts cache
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: |
|
||||
js/cf-webapp/public/web-tree-sitter.wasm
|
||||
js/cf-webapp/public/tree-sitter-python.wasm
|
||||
js/cf-webapp/public/.tree-sitter-python-version
|
||||
key: wasm-${{ runner.os }}-${{ hashFiles('js/pnpm-lock.yaml') }}
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: js
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Build common package
|
||||
working-directory: js
|
||||
run: pnpm --filter @codeflash-ai/common build
|
||||
|
||||
- name: Generate Prisma client for cf-webapp
|
||||
working-directory: js/cf-webapp
|
||||
run: pnpm prisma generate
|
||||
|
||||
- name: Restore Next.js build cache
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: js/cf-webapp/.next/cache
|
||||
key: nextjs-${{ runner.os }}-${{ hashFiles('js/pnpm-lock.yaml') }}-${{ hashFiles('js/cf-webapp/src/**') }}
|
||||
restore-keys: |
|
||||
nextjs-${{ runner.os }}-${{ hashFiles('js/pnpm-lock.yaml') }}-
|
||||
nextjs-${{ runner.os }}-
|
||||
|
||||
- name: Type-check
|
||||
id: typecheck
|
||||
working-directory: js/cf-webapp
|
||||
run: pnpm tsc --noEmit
|
||||
continue-on-error: true
|
||||
|
||||
- name: Tests
|
||||
id: tests
|
||||
working-directory: js/cf-webapp
|
||||
run: pnpm vitest run --reporter=verbose 2>&1 | tee test-output.txt
|
||||
continue-on-error: true
|
||||
|
||||
- name: Build
|
||||
id: build
|
||||
working-directory: js/cf-webapp
|
||||
run: pnpm next build 2>&1 | tee build-output.txt
|
||||
continue-on-error: true
|
||||
|
||||
- name: Extract results
|
||||
id: results
|
||||
working-directory: js/cf-webapp
|
||||
run: |
|
||||
# Type-check status
|
||||
if [ "${{ steps.typecheck.outcome }}" = "success" ]; then
|
||||
echo "typecheck_status=✅ Pass" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "typecheck_status=❌ Fail" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
# Test summary
|
||||
if [ "${{ steps.tests.outcome }}" = "success" ]; then
|
||||
TESTS_SUMMARY=$(grep -E "Tests\s+[0-9]+" test-output.txt | tail -1 || echo "passed")
|
||||
echo "tests_status=✅ ${TESTS_SUMMARY}" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "tests_status=❌ Tests failed" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
# Build status
|
||||
if [ "${{ steps.build.outcome }}" = "success" ]; then
|
||||
echo "build_status=✅ Success" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "build_status=❌ Fail" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
# Extract route sizes from build output
|
||||
ROUTES=$(sed -n '/Route.*Size.*First Load/,/^$/p' build-output.txt | head -30 || echo "No route data")
|
||||
{
|
||||
echo "routes<<ROUTES_EOF"
|
||||
echo "$ROUTES"
|
||||
echo "ROUTES_EOF"
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Post PR comment
|
||||
if: github.event_name == 'pull_request'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh pr comment ${{ github.event.pull_request.number }} \
|
||||
--repo ${{ github.repository }} \
|
||||
--body "$(cat <<'COMMENT_EOF'
|
||||
## cf-webapp Quality Report
|
||||
|
||||
| Check | Result |
|
||||
|-------|--------|
|
||||
| Type-check | ${{ steps.results.outputs.typecheck_status }} |
|
||||
| Tests | ${{ steps.results.outputs.tests_status }} |
|
||||
| Build | ${{ steps.results.outputs.build_status }} |
|
||||
|
||||
<details>
|
||||
<summary>Route Sizes</summary>
|
||||
|
||||
```
|
||||
${{ steps.results.outputs.routes }}
|
||||
```
|
||||
</details>
|
||||
COMMENT_EOF
|
||||
)"
|
||||
|
||||
- name: Fail if any check failed
|
||||
if: steps.typecheck.outcome == 'failure' || steps.tests.outcome == 'failure' || steps.build.outcome == 'failure'
|
||||
run: exit 1
|
||||
Loading…
Reference in a new issue