Skip to content

Commit

Permalink
Add CI stage for memory benchmark (#981)
Browse files Browse the repository at this point in the history
This PR adds the CI stage for #976, which compares `main`'s result to
the feature branch's result. This CI will not pass until #976 goes in.

Eventually, we should probably write our own Github Action to combine
the benchmarks from #955 and these memory benchmarks into one PR
comment. That'll reduce the noisy github-actions bot comments.
  • Loading branch information
sezna authored Jan 8, 2024
1 parent b6e9a0b commit 9ec21ca
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,41 @@ jobs:
branchName: ${{ github.base_ref }}
cwd: "compiler/qsc"
if: ${{ github.base_ref != null }}
runMemoryProfile:
name: run memory profile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: main
- uses: Swatinem/rust-cache@v2
- run: |
MAIN_MEASUREMENT=$(cargo run --bin memtest)
echo "MAIN_MEASUREMENT<<EOF" >> $GITHUB_ENV
echo "$MAIN_MEASUREMENT" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- run: |
echo "${{env.MAIN_MEASUREMENT}}"
echo $MAIN_MEASUREMENT
- uses: actions/checkout@v2
- run: |
BRANCH_MEASUREMENT=$(cargo run --bin memtest)
echo "BRANCH_MEASUREMENT<<EOF" >> $GITHUB_ENV
echo "$BRANCH_MEASUREMENT" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- run: |
echo "${{env.BRANCH_MEASUREMENT}}"
echo $BRANCH_MEASUREMENT
- uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `## Memory Report for ${{ github.sha }}
| Test | This Branch | On Main |
|-----------------------------|-------------|----------|
| compile core + standard lib | ${{ env.BRANCH_MEASUREMENT }} bytes | ${{ env.MAIN_MEASUREMENT }} bytes |`
})

0 comments on commit 9ec21ca

Please sign in to comment.