-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI production build size summary (#401)
- Loading branch information
1 parent
599597a
commit c65d99f
Showing
3 changed files
with
247 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: PR Comment Generation | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Build and Test"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
comment_on_pr: | ||
runs-on: ubuntu-latest | ||
if: > | ||
github.event.workflow_run.event == 'pull_request' && | ||
github.event.workflow_run.conclusion == 'success' | ||
steps: | ||
- name: 'Download artifact' | ||
uses: actions/[email protected] | ||
with: | ||
script: | | ||
const fs = require('fs'); | ||
const artifacts = await github.actions.listWorkflowRunArtifacts({ | ||
...context.repo, | ||
run_id: ${{github.event.workflow_run.id }}, | ||
}); | ||
const matchArtifact = artifacts.data.artifacts.filter((artifact) => { | ||
return artifact.name == "pr" | ||
})[0]; | ||
const download = await github.actions.downloadArtifact({ | ||
...context.repo, | ||
artifact_id: matchArtifact.id, | ||
archive_format: 'zip', | ||
}); | ||
fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data)); | ||
- run: unzip pr.zip | ||
|
||
- name: 'Comment on PR' | ||
uses: actions/github-script@v3 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
const fs = require('fs'); | ||
const issueNumber = Number(fs.readFileSync('./NR')); | ||
const summaryContent = fs.readFileSync('./step_summary.md', 'utf-8'); | ||
const existingCommentsOpts = github.issues.listComments.endpoint.merge({ | ||
...context.repo, issue_number: issueNumber | ||
}); | ||
const existingComments = await github.paginate(existingCommentsOpts); | ||
const TAG = 'execution'; | ||
const tagPattern = `<!-- pr_asset_summary_comment "${TAG}" -->`; | ||
const body = `${summaryContent}\n${tagPattern}`; | ||
const preExistingComment = existingComments.find((comment) => comment.body?.includes(tagPattern)); | ||
if(preExistingComment) { | ||
await github.issues.updateComment({ ...context.repo, comment_id: preExistingComment.id, body }); | ||
} else { | ||
await github.issues.createComment({ ...context.repo, issue_number: issueNumber, body }); | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
rm -rf report_pkg | ||
mkdir -p report_pkg | ||
|
||
echo "Building arrow-rs slim" | ||
wasm-pack build \ | ||
--release \ | ||
--no-pack \ | ||
--out-dir report_pkg/slim \ | ||
--out-name arrow1 \ | ||
--target web \ | ||
--features=arrow1 & | ||
echo "Building arrow-rs sync" | ||
wasm-pack build \ | ||
--release \ | ||
--no-pack \ | ||
--out-dir report_pkg/sync \ | ||
--out-name arrow1 \ | ||
--target web \ | ||
--features={arrow1,reader,writer,all_compressions} & | ||
|
||
echo "Building arrow-rs async_full" | ||
wasm-pack build \ | ||
--release \ | ||
--no-pack \ | ||
--out-dir report_pkg/async_full \ | ||
--out-name arrow1 \ | ||
--target web \ | ||
--features={arrow1,reader,writer,all_compressions,async} & | ||
|
||
wait; |