Skip to content

Commit

Permalink
add comment on pull request
Browse files Browse the repository at this point in the history
Signed-off-by: Desiki-high <ding_yadong@foxmail.com>
  • Loading branch information
Desiki-high committed Apr 19, 2023
1 parent d094320 commit c8aaeb2
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: Smoke Test

permissions:
pull-requests: write

on:
push:
branches: ["*", "**"]
paths-ignore: [ '**.md', '**.png', '**.jpg', '**.svg', '**/docs/**' ]
pull_request_target:
pull_request:
branches: ["*", "**"]
paths-ignore: [ '**.md', '**.png', '**.jpg', '**.svg', '**/docs/**' ]
schedule:
Expand Down Expand Up @@ -396,6 +399,7 @@ jobs:

benchmark-result:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
needs: [benchmark-oci, benchmark-zran-all-prefetch, benchmark-nydus-no-prefetch, benchmark-nydus-all-prefetch, benchmark-nydus-filelist-prefetch]
steps:
- name: Download benchmark-oci
Expand Down Expand Up @@ -432,7 +436,7 @@ jobs:
sudo install -m 755 benchmark-nydus-filelist-prefetch/wordpress.csv benchmark-nydus-filelist-prefetch.csv
echo "| bench-result | pull-elapsed(s) | create-elapsed(s) | run-elapsed(s) | total-elapsed(s) |" > result.md
echo "|:-------:|:-----------------:|:-------------------:|:----------------:|:------------------:|" >> result.md
echo "|-------:|:-----------------:|:-------------------:|:----------------:|:------------------:|" >> result.md
for file in *.csv; do
if ! [ -f "$file" ]; then
Expand All @@ -448,10 +452,19 @@ jobs:
done >> result.md
done
- name: Comment
uses: peter-evans/create-or-update-comment@v3
uses: actions/github-script@v6
with:
issue-number: ${{ github.event.pull_request.number }}
body-path: 'result.md'
script: |
const fs = require('fs');
const markdownFilePath = './result.md';
const markdownContent = fs.readFileSync(markdownFilePath, 'utf8');
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: markdownContent
})
nydus-unit-test:
runs-on: ubuntu-latest
Expand Down

0 comments on commit c8aaeb2

Please sign in to comment.