Skip to content

Commit

Permalink
add no-rollup check too
Browse files Browse the repository at this point in the history
  • Loading branch information
runspired committed Nov 30, 2019
1 parent cda7a36 commit 64c8075
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/asset-size-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,14 @@ jobs:
- name: Install dependencies for master
run: yarn install
- name: Build Production master (IE11)
# This will leave the assets in a dist that is maintained when
# We switch back to the primary branch
run: |
mkdir -p packages/-ember-data/dists
TARGET_IE11=true yarn workspace ember-data ember build -e production --output-path dists/control-ie11
- name: Build Production master
# This will leave the assets in a dist that is maintained when
# We switch back to the primary branch
run: yarn workspace ember-data ember build -e production --output-path dists/control
- name: Build Production master (no rollup)
run: EMBER_DATA_ROLLUP_PRIVATE=false yarn workspace ember-data ember build -e production --output-path dists/control-no-rollup
- name: Checkout ${{github.ref}}
# We checkout the PR Branch before parsing the master vendor file
# So that we are always using the current analysis tooling
run: |
sha=$(cat tmp/sha-for-check.txt)
git checkout --progress --force $sha
Expand All @@ -50,6 +46,8 @@ jobs:
run: TARGET_IE11=true yarn workspace ember-data ember build -e production --output-path dists/experiment-ie11
- name: Build Production ${{github.ref}}
run: yarn workspace ember-data ember build -e production --output-path dists/experiment
- name: Build Production ${{github.ref}} (no rollup)
run: EMBER_DATA_ROLLUP_PRIVATE=false yarn workspace ember-data ember build -e production --output-path dists/experiment-no-rollup
- name: Analyze Master Assets (IE11)
run: |
node ./bin/asset-size-tracking/generate-analysis.js packages/-ember-data/dists/control-ie11 ./control-ie11-data.json
Expand All @@ -60,6 +58,10 @@ jobs:
run: |
node ./bin/asset-size-tracking/generate-analysis.js packages/-ember-data/dists/control ./control-data.json
node ./bin/asset-size-tracking/print-analysis.js ./control-data.json -show > tmp/asset-sizes/master-analysis.txt
- name: Analyze Master Assets (no rollup)
run: |
node ./bin/asset-size-tracking/generate-analysis.js packages/-ember-data/dists/control-no-rollup ./control-data-no-rollup.json
node ./bin/asset-size-tracking/print-analysis.js ./control-data-no-rollup.json -show > tmp/asset-sizes/master-analysis-no-rollup.txt
- name: Analyze ${{github.ref}} Assets (IE11)
run: |
node ./bin/asset-size-tracking/generate-analysis.js packages/-ember-data/dists/experiment-ie11 ./experiment-ie11-data.json
Expand All @@ -68,6 +70,10 @@ jobs:
run: |
node ./bin/asset-size-tracking/generate-analysis.js packages/-ember-data/dists/experiment ./experiment-data.json
node ./bin/asset-size-tracking/print-analysis.js ./experiment-data.json > tmp/asset-sizes/experiment-analysis.txt
- name: Analyze ${{github.ref}} Assets
run: |
node ./bin/asset-size-tracking/generate-analysis.js packages/-ember-data/dists/experiment-no-rollup ./experiment-data-no-rollup.json
node ./bin/asset-size-tracking/print-analysis.js ./experiment-data-no-rollup.json > tmp/asset-sizes/experiment-analysis-no-rollup.txt
- name: Test Asset Sizes (IE11)
run: |
set -o pipefail
Expand All @@ -77,6 +83,11 @@ jobs:
run: |
set -o pipefail
node ./bin/asset-size-tracking/generate-diff.js ./control-data.json ./experiment-data.json | tee tmp/asset-sizes/diff.txt
- name: Test Asset Sizes
if: failure() || success()
run: |
# we don't set -o pipefail as this should always pass, we just want the diff
node ./bin/asset-size-tracking/generate-diff.js ./control-data-no-rollup.json ./experiment-data-no-rollup.json | tee tmp/asset-sizes/diff-no-rollup.txt
- name: Upload Dist Artifacts
if: failure() || success()
uses: actions/upload-artifact@v1
Expand Down
11 changes: 10 additions & 1 deletion bin/asset-size-tracking/src/create-comment-text.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,22 @@ const IE11DiffPath = path.resolve(__dirname, '../../../tmp/asset-sizes/diff-ie11
const IE11AnalysisPath = path.resolve(__dirname, '../../../tmp/asset-sizes/experiment-analysis-ie11.txt');
const ModernDiffPath = path.resolve(__dirname, '../../../tmp/asset-sizes/diff.txt');
const ModernAnalysisPath = path.resolve(__dirname, '../../../tmp/asset-sizes/experiment-analysis.txt');
const ModernDiffPathNoRollup = path.resolve(__dirname, '../../../tmp/asset-sizes/diff-no-rollup.txt');
const ModernAnalysisPathNoRollup = path.resolve(
__dirname,
'../../../tmp/asset-sizes/experiment-analysis-no-rollup.txt'
);

const IE11DiffText = fs.readFileSync(IE11DiffPath);
const IE11AnalysisText = fs.readFileSync(IE11AnalysisPath);
const ModernDiffText = fs.readFileSync(ModernDiffPath);
const ModernAnalysisText = fs.readFileSync(ModernAnalysisPath);
const ModernDiffTextNoRollup = fs.readFileSync(ModernDiffPathNoRollup);
const ModernAnalysisTextNoRollup = fs.readFileSync(ModernAnalysisPathNoRollup);

const commentText = `Asset Size Report for ${GITHUB_SHA}\n\n**IE11 Builds**\n${IE11DiffText}\n<details>\n <summary>Full Asset Analysis (IE11)</summary>\n\n\`\`\`${IE11AnalysisText}\n\`\`\`\n</details>\n\n**Modern Builds**\n${ModernDiffText}\n<details>\n <summary>Full Asset Analysis (Modern)</summary>\n\n\`\`\`${ModernAnalysisText}\n\`\`\`\n</details>`;
const commentText = `Asset Size Report for ${GITHUB_SHA}\n\n**IE11 Builds**\n${IE11DiffText}\n<details>\n <summary>Full Asset Analysis (IE11)</summary>\n\n\`\`\`${IE11AnalysisText}\n\`\`\`\n</details>
\n**Modern Builds**\n${ModernDiffText}\n<details>\n <summary>Full Asset Analysis (Modern)</summary>\n\n\`\`\`${ModernAnalysisText}\n\`\`\`\n</details>
\n**Modern Builds (No Rollup)**\n${ModernDiffTextNoRollup}\n<details>\n <summary>Full Asset Analysis (Modern)</summary>\n\n\`\`\`${ModernAnalysisTextNoRollup}\n\`\`\`\n</details>`;
const commentJSON = {
body: commentText,
};
Expand Down

0 comments on commit 64c8075

Please sign in to comment.