Skip to content

Commit 1b92c88

Browse files
committed
[benchmarks] First working PR comment.
1 parent b7bff1c commit 1b92c88

File tree

2 files changed

+33
-23
lines changed

2 files changed

+33
-23
lines changed

.github/workflows/continuous-benchmark.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
uses: actions/checkout@v2
2424
with:
2525
repository: lf-lang/benchmarks-lingua-franca
26-
ref: continuous-benchmarking # FIXME: delete this line after merge
26+
ref: automated-full-benchmark # FIXME: delete this line after merge
2727

2828
- name: Set up workspace
2929
uses: ./.github/actions/set-up-workspace
Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: User-requested benchmarks
2+
23
on:
34
issue_comment:
45
types: [created]
@@ -8,6 +9,11 @@ on:
89
pr_number:
910
required: true
1011
type: number
12+
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
1117
jobs:
1218
run_benchmarks:
1319
runs-on: ubuntu-latest
@@ -17,10 +23,21 @@ jobs:
1723
uses: actions/checkout@v2
1824
with:
1925
repository: lf-lang/benchmarks-lingua-franca
20-
ref: cb # FIXME: delete this line after merge
26+
token: ${{ secrets.GITHUB_TOKEN }}
27+
fetch-depth: 1
28+
ref: automated-full-benchmark # FIXME: delete this line after merge
29+
30+
- name: Checkout reactor-c
31+
uses: actions/checkout@v2
32+
with:
33+
repository: lf-lang/reactor-c
34+
token: ${{ secrets.GITHUB_TOKEN }}
35+
fetch-depth: 0 # It will be necessary to push to this repo
36+
ref: automated-full-benchmark # FIXME: delete this line after merge
37+
path: reactor-c
2138

2239
- name: Set up workspace
23-
uses: lf-lang/reactor-c/.github/actions/set-up-workspace@continuous-benchmarking
40+
uses: lf-lang/reactor-c/.github/actions/set-up-workspace@automated-full-benchmark
2441

2542
- name: Run C Benchmarks
2643
# run: |
@@ -38,43 +55,36 @@ jobs:
3855
./runner/collect_results.py latest latest-benchmark-results.csv
3956
shell: bash
4057

41-
- name: Checkout repository for saving graphics
42-
uses: actions/checkout@v2
43-
with:
44-
repository: lf-lang/benchmarks-lingua-franca
45-
ref: graphics
46-
path: graphics-repo
47-
fetch-depth: 0 # History is required for push
48-
4958
- name: Make figure
5059
run: |
51-
OUTPUT_DIR=runner/images/$(date -I)
60+
OUTPUT_DIR=images/$(date -I)
5261
SHA=${{ github.sha }}
5362
OUTPUT_FILE=$OUTPUT_DIR/${SHA:0:7}.png
54-
mkdir -p graphics-repo/$OUTPUT_DIR
55-
./runner/make-graphics.py latest-benchmark-results.csv graphics-repo/$OUTPUT_FILE
63+
mkdir -p reactor-c/$OUTPUT_DIR
64+
./runner/make-graphics.py latest-benchmark-results.csv reactor-c/$OUTPUT_FILE
5665
echo "::set-output name=output_file::$OUTPUT_FILE"
5766
shell: bash
5867
id: figure
5968

6069
- name: Commit figure
6170
run: |
62-
cd graphics-repo
71+
cd reactor-c
6372
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
6473
git config --global user.name "github-actions[bot]"
74+
git fetch
75+
git switch graphics
6576
git add ${{ steps.figure.outputs.OUTPUT_FILE }}
6677
git commit -m "benchmark ${{ github.sha }}"
67-
68-
- name: Push figure
69-
uses: ad-m/github-push-action@master
70-
with:
71-
github_token: ${{ secrets.GITHUB_TOKEN }}
72-
branch: graphics
78+
git config -l | grep 'http\..*\.extraheader' | cut -d= -f1 | \
79+
xargs -L1 git config --unset-all
80+
git push https://token:${{ secrets.GITHUB_TOKEN }}@github.com/lf-lang/reactor-c.git
81+
cd ..
82+
shell: bash
7383

7484
- name: Comment PR
7585
uses: thollander/actions-comment-pull-request@v1
7686
with:
7787
message: |
78-
![Visualization of the benchmark results.](https://raw.githubusercontent.com/lf-lang/benchmarks-lingua-franca/graphics/${{ steps.figure.outputs.OUTPUT_FILE }})
79-
pr_number: 51 # ${{ inputs.pr_number }}
88+
![Visualization of the benchmark results.](https://raw.githubusercontent.com/lf-lang/reactor-c/graphics/${{ steps.figure.outputs.OUTPUT_FILE }})
89+
pr_number: 91 # ${{ inputs.pr_number }}
8090
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)