Skip to content

comment

comment #19

Workflow file for this run

---
name: ubuntu
permissions: read-all
on: [ workflow_dispatch, pull_request ]
env:
CSV_FILE_PREFIX: https://pub-95669c22c66d453c92c62f20aa0c5b57.r2.dev
BUCKET: github-action
BASE: main
JOBS: "main_again pr"
jobs:
main:
uses: ./.github/workflows/benchmark-template.yaml
with:
runs-on: ubuntu-latest
branch: main
script: benchmark-small.sh
main_again:
uses: ./.github/workflows/benchmark-template.yaml
with:
runs-on: ubuntu-latest
branch: main
script: benchmark-small.sh
pr:
uses: ./.github/workflows/benchmark-template.yaml
with:
runs-on: ubuntu-latest
branch: ${{ github.event.pull_request.head.ref }}
script: benchmark-small.sh
compare:
permissions: write-all
needs: [ main, pr, main_again ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.23'
cache-dependency-path: go.sum
- name: collect outputs of each jobs
run: |
echo "${{ needs.main.outputs.results }}" | base64 -d > main.csv
echo "${{ needs.main_again.outputs.results }}" | base64 -d > main_again.csv
echo "${{ needs.pr.outputs.results }}" | base64 -d > pr.csv
- name: build rw-heatmaps
run: go build -C tools/rw-heatmaps
- name: compare
run: |
for job in $JOBS; do
./tools/rw-heatmaps/rw-heatmaps main.csv $job.csv -t "main vs $job" -o $job
done
- name: zip
run: zip -r archive.zip *.csv *.jpg ./scripts/*.sh
- name: write names to env
run: |
DATE=$(date '+%Y%m%d-%H-%M-%S')
echo "ZIP_OBJECT_NAME=etcd-benchmark-$DATE.zip" >> $GITHUB_ENV
for job in $JOBS; do
echo "COMPARE_READ_OBJECT_NAME_$job=etcd-benchmark-$DATE-$job-read.jpg" >> $GITHUB_ENV
echo "COMPARE_WRITE_OBJECT_NAM_$job=etcd-benchmark-$DATE-$job-write.jpg" >> $GITHUB_ENV
done
- name: print md
id: set_content
run: |
CONTENT=$(cat <<EOF
Read-Write Heatmap

Check failure on line 72 in .github/workflows/ubuntu.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/ubuntu.yaml

Invalid workflow file

You have an error in your yaml syntax on line 72
main vs PR:
<details>
<summary><kbd>read</kbd></summary>
<img alt="read" src="$CSV_FILE_PREFIX/$COMPARE_READ_OBJECT_NAME_PR">
</details>
<details>
<summary><kbd>write</kbd></summary>
<img alt="write" src="$CSV_FILE_PREFIX/$COMPARE_WRITE_OBJECT_NAME_PR">
</details>
main vs main:
<details>
<summary><kbd>read</kbd></summary>
<img alt="read" src="$CSV_FILE_PREFIX/$COMPARE_READ_OBJECT_NAME_main_again">
</details>
<details>
<summary><kbd>write</kbd></summary>
<img alt="write" src="$CSV_FILE_PREFIX/$COMPARE_WRITE_OBJECT_NAME_main_again">
</details>
[archive.zip]($CSV_FILE_PREFIX/$ZIP_OBJECT_NAME)
EOF
)
echo $CONTENT >> "$GITHUB_STEP_SUMMARY"
echo "::set-output name=content::$CONTENT"
- name: install wrangler
run: npm install wrangler
- name: upload to r2
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: |
npx wrangler r2 object put $BUCKET/$ZIP_OBJECT_NAME --file=archive.zip
for job in $JOBS; do
varname=COMPARE_READ_OBJECT_NAME_$job
npx wrangler r2 object put $BUCKET/${!varname} --file=$job'_read.jpg'
varname=COMPARE_WRITE_OBJECT_NAM_$job
npx wrangler r2 object put $BUCKET/${!varname} --file=$job'_write.jpg'
done
- name: 'comment PR'
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `${{ steps.set_content.outputs.content }}`
})