Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 6 additions & 50 deletions .github/workflows/code-pushup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
env:
NX_NON_NATIVE_HASHER: true

permissions:
pull-requests: write

jobs:
code-pushup:
runs-on: ubuntu-latest
Expand All @@ -28,54 +31,7 @@ jobs:
cache: npm
- name: Install dependencies
run: npm ci
- name: Collect Code PushUp report
run: npx nx code-pushup -- collect
- name: Upload Code PushUp report to portal
run: npx nx code-pushup -- upload
- name: Save report files as workflow artifact
uses: actions/upload-artifact@v4
with:
name: code-pushup-report
path: .code-pushup/

code-pushup-comment:
runs-on: ubuntu-latest
name: Code PushUp comment
needs: [code-pushup]
if: ${{ github.event_name == 'pull_request' }}
permissions:
pull-requests: write
steps:
- name: Checkout repository at base branch
uses: actions/checkout@v4
with:
ref: ${{ github.base_ref }}
- name: Download report workflow artifact
uses: actions/download-artifact@v4
with:
name: code-pushup-report
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
- name: Install dependencies
run: npm ci
- name: Collect Code PushUp report for base branch
run: npx nx code-pushup -- collect --persist.outputDir=. --persist.filename=base-report --persist.format=json
- name: Compare Code PushUp reports
run: npx nx code-pushup -- compare --before=base-report.json --after=report.json
- name: Find previous comment
uses: peter-evans/find-comment@v3
id: find-comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Code PushUp
- name: Create or update comment
uses: peter-evans/create-or-update-comment@v4
- name: Run Code PushUp action
uses: code-pushup/github-action@v0
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
edit-mode: replace
body-path: .code-pushup/report-diff.md
bin: npx nx code-pushup --
21 changes: 10 additions & 11 deletions code-pushup.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import 'dotenv/config';
import { join } from 'node:path';
import { z } from 'zod';
import {
LIGHTHOUSE_OUTPUT_FILE_DEFAULT,
// LIGHTHOUSE_OUTPUT_FILE_DEFAULT,
fileSizePlugin,
fileSizeRecommendedRefs,
lighthouseCorePerfGroupRefs,
lighthousePlugin,
fileSizeRecommendedRefs, // lighthouseCorePerfGroupRefs,
// lighthousePlugin,
packageJsonDocumentationGroupRef,
packageJsonPerformanceGroupRef,
packageJsonPlugin,
Expand Down Expand Up @@ -77,11 +75,12 @@ const config: CoreConfig = {
type: 'module',
}),

await lighthousePlugin({
url: 'https://staging.code-pushup.dev/login',
outputPath: join('.code-pushup', LIGHTHOUSE_OUTPUT_FILE_DEFAULT),
headless: true,
}),
// see https://github.com/code-pushup/cli/issues/538
// await lighthousePlugin({
// url: 'https://staging.code-pushup.dev/login',
// outputPath: join('.code-pushup', LIGHTHOUSE_OUTPUT_FILE_DEFAULT),
// headless: true,
// }),
],

categories: [
Expand Down Expand Up @@ -140,7 +139,7 @@ const config: CoreConfig = {
...fileSizeRecommendedRefs,
packageJsonPerformanceGroupRef,
packageJsonDocumentationGroupRef,
...lighthouseCorePerfGroupRefs,
// ...lighthouseCorePerfGroupRefs,
],
},
],
Expand Down