Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/comment-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Comment on pull request

on:
workflow_run:
workflows: ["Performance"]
types: [completed]

jobs:
post-comment:
name: Post PR comment
runs-on: ubuntu-latest
permissions:
pull-requests: write
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'}}
steps:
- name: Download comment
uses: actions/download-artifact@v4
with:
name: perf-report
path: perf-report.txt
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}

- name: Post message to PR
uses: mshick/add-pr-comment@dd126dd8c253650d181ad9538d8b4fa218fc31e8
with:
message-path: perf-report.txt
issue: ${{ github.event.workflow_run.pull_requests[0].number }}
12 changes: 6 additions & 6 deletions .github/workflows/performance.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Performance

on:
pull_request_target:
pull_request:
branches: [main]

jobs:
Expand Down Expand Up @@ -37,8 +37,6 @@ jobs:
runs-on: ubuntu-22.04
needs: build
name: Benchmark chisel info (chisel-releases 24.04)
permissions:
pull-requests: write
steps:
- name: Download base
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -68,7 +66,9 @@ jobs:
chmod +x base head
hyperfine --export-markdown "$msg_file" "./base info --release ./chisel-releases 'python3.12_core'" -n "BASE" "./head info --release ./chisel-releases 'python3.12_core'" -n "HEAD"

- name: Post message to PR
uses: mshick/add-pr-comment@v2
- name: Upload result
uses: actions/upload-artifact@v4
with:
message-path: ${{ steps.benchmark.outputs.msg_file }}
name: perf-report
path: ${{ steps.benchmark.outputs.msg_file }}
retention-days: 1
2 changes: 2 additions & 0 deletions cmd/chisel/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import (
//"github.com/canonical/chisel/internal/logger"
)

// TEST

var (
// Standard streams, redirected for testing.
Stdin io.Reader = os.Stdin
Expand Down