Skip to content

Commit

Permalink
generate pages using branch (fake build to test)
Browse files Browse the repository at this point in the history
  • Loading branch information
izaera committed Feb 11, 2025
1 parent bfb795d commit e9eb3ad
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 44 deletions.
18 changes: 2 additions & 16 deletions .github/workflows/performance-report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ permissions:
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

env:
ANT_OPTS: -Xmx2561m
CREATE_BUNDLE_REPORTS: yes
Expand All @@ -37,14 +31,6 @@ jobs:
with:
java-version: '21'
distribution: 'temurin'
- run: ./build_dxp.sh
# - run: ./build_dxp.sh
- run: ./generate_reports.sh
- name: Setup GitHub Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'REPORTS'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- run: ./generate_pages.sh
3 changes: 3 additions & 0 deletions constants.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
COMMIT_SHA=$(git rev-parse master)
DATE=$(date --iso-8601)
REPORTS_DIR="$(realpath ../reports)"
34 changes: 34 additions & 0 deletions generate_pages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/bash

source constants.sh

git checkout gh-pages

cp "${REPORTS_DIR}"/* .

echo "
<html>
<head>
<title>Reports for ${DATE} [${COMMIT_SHA}]</title>
</head>
<body>
<h2>Comparison:</h2>
TODO
<hr>
<h2>Raw CSV files:</h2>
<a href="./bundle-sizes.csv">bundle-sizes.csv</a>
<a href="./bundle-sizes-with-internals.csv">bundle-sizes-with-internals.csv</a>
<a href="./bundle-imports.csv">bundle-imports.csv</a>
<a href="./source-imports.csv">source-imports.csv</a>
<a href="./java-imports.csv">java-imports.csv</a>
</body>
</html>
" > index.html

git add .
git commit -m "Reports for ${DATE} [${COMMIT_SHA}]"
git push
41 changes: 13 additions & 28 deletions generate_reports.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
#!/usr/bin/bash

COMMIT_SHA=$(git rev-parse master)
DATE=$(date --iso-8601)
source constants.sh


# REMOVE REMOVE REMOVE
echo holi > "${REPORTS_DIR}/bundle-sizes.csv"
echo holi > "${REPORTS_DIR}/bundle-sizes-with-internals.csv"
echo holi > "${REPORTS_DIR}/bundle-imports.csv"
echo holi > "${REPORTS_DIR}/source-imports.csv"
echo holi > "${REPORTS_DIR}/java-imports.csv"
exit 0
# REMOVE REMOVE REMOVE

(
cd modules
Expand All @@ -13,29 +22,5 @@ DATE=$(date --iso-8601)
yarn node-scripts report:java:imports
)

mkdir REPORTS

mv modules/*.csv REPORTS

echo `
<html>
<head>
<title>Reports for ${DATE} [${COMMIT_SHA}]</title>
</head>
<body>
<h2>Comparison:</h2>
TODO
<hr>
<h2>Raw CSV files:</h2>
<a href="./bundle-sizes.csv">bundle-sizes.csv</a>
<a href="./bundle-sizes-with-internals.csv">bundle-sizes-with-internals.csv</a>
<a href="./bundle-imports.csv">bundle-imports.csv</a>
<a href="./source-imports.csv">source-imports.csv</a>
<a href="./java-imports.csv">java-imports.csv</a>
</body>
</html>
` > REPORTS/index.html
mkdir -p "${REPORTS_DIR}"
mv modules/*.csv "${REPORTS_DIR}"

0 comments on commit e9eb3ad

Please sign in to comment.