diff --git a/.github/workflows/continuous-benchmark.yml b/.github/workflows/continuous-benchmark.yml index af4d45ab8..cba3fca5e 100644 --- a/.github/workflows/continuous-benchmark.yml +++ b/.github/workflows/continuous-benchmark.yml @@ -23,7 +23,7 @@ jobs: uses: actions/checkout@v2 with: repository: lf-lang/benchmarks-lingua-franca - ref: continuous-benchmarking # FIXME: delete this line after merge + ref: automated-full-benchmark # FIXME: delete this line after merge - name: Set up workspace uses: ./.github/actions/set-up-workspace diff --git a/.github/workflows/user-requested-benchmark.yml b/.github/workflows/user-requested-benchmark.yml index 20a5b6b75..d8bf22a3b 100644 --- a/.github/workflows/user-requested-benchmark.yml +++ b/.github/workflows/user-requested-benchmark.yml @@ -1,4 +1,5 @@ name: User-requested benchmarks + on: issue_comment: types: [created] @@ -8,6 +9,11 @@ on: pr_number: required: true type: number + +permissions: + contents: write + pull-requests: write + jobs: run_benchmarks: runs-on: ubuntu-latest @@ -17,10 +23,21 @@ jobs: uses: actions/checkout@v2 with: repository: lf-lang/benchmarks-lingua-franca - ref: cb # FIXME: delete this line after merge + token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 1 + ref: automated-full-benchmark # FIXME: delete this line after merge + + - name: Checkout reactor-c + uses: actions/checkout@v2 + with: + repository: lf-lang/reactor-c + token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 # It will be necessary to push to this repo + ref: automated-full-benchmark # FIXME: delete this line after merge + path: reactor-c - name: Set up workspace - uses: lf-lang/reactor-c/.github/actions/set-up-workspace@continuous-benchmarking + uses: lf-lang/reactor-c/.github/actions/set-up-workspace@automated-full-benchmark - name: Run C Benchmarks # run: | @@ -38,43 +55,36 @@ jobs: ./runner/collect_results.py latest latest-benchmark-results.csv shell: bash - - name: Checkout repository for saving graphics - uses: actions/checkout@v2 - with: - repository: lf-lang/benchmarks-lingua-franca - ref: graphics - path: graphics-repo - fetch-depth: 0 # History is required for push - - name: Make figure run: | - OUTPUT_DIR=runner/images/$(date -I) + OUTPUT_DIR=images/$(date -I) SHA=${{ github.sha }} OUTPUT_FILE=$OUTPUT_DIR/${SHA:0:7}.png - mkdir -p graphics-repo/$OUTPUT_DIR - ./runner/make-graphics.py latest-benchmark-results.csv graphics-repo/$OUTPUT_FILE + mkdir -p reactor-c/$OUTPUT_DIR + ./runner/make-graphics.py latest-benchmark-results.csv reactor-c/$OUTPUT_FILE echo "::set-output name=output_file::$OUTPUT_FILE" shell: bash id: figure - name: Commit figure run: | - cd graphics-repo + cd reactor-c git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" + git fetch + git switch graphics git add ${{ steps.figure.outputs.OUTPUT_FILE }} git commit -m "benchmark ${{ github.sha }}" - - - name: Push figure - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: graphics + git config -l | grep 'http\..*\.extraheader' | cut -d= -f1 | \ + xargs -L1 git config --unset-all + git push https://token:${{ secrets.GITHUB_TOKEN }}@github.com/lf-lang/reactor-c.git + cd .. + shell: bash - name: Comment PR uses: thollander/actions-comment-pull-request@v1 with: message: | - ![Visualization of the benchmark results.](https://raw.githubusercontent.com/lf-lang/benchmarks-lingua-franca/graphics/${{ steps.figure.outputs.OUTPUT_FILE }}) - pr_number: 51 # ${{ inputs.pr_number }} + ![Visualization of the benchmark results.](https://raw.githubusercontent.com/lf-lang/reactor-c/graphics/${{ steps.figure.outputs.OUTPUT_FILE }}) + pr_number: 91 # ${{ inputs.pr_number }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}