Skip to content

Commit

Permalink
fix benchmark action (#2314)
Browse files Browse the repository at this point in the history
  • Loading branch information
voidpumpkin committed Dec 29, 2021
1 parent c91364b commit b886412
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,27 @@ name: Benchmark

on:
pull_request:
if: >-
(github.event.action == 'labeled' && github.event.label.name == 'performance') ||
(github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'performance'))
branches: [master]
types: [labeled, synchronize]

workflow_dispatch:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest

if: >-
(github.event.action == 'labeled' && github.event.label.name == 'performance') ||
(github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'performance'))
steps:
- uses: actions/checkout@v2
with:
repository: bakape/js-framework-benchmark
repository: yewstack/js-framework-benchmark

- name: Configure benchmark
run: |
replace="yew = { git = \"${{ github.event.pull_request.head.repo.html_url }}\", branch = \"${{ github.event.pull_request.head.ref }}\" }"
replace="yew = { git = \"${REPO_HTML_URL}\", branch = \"${BRANCH}\" }"
input=$(cat frameworks/keyed/yew/Cargo.toml)
output=$(echo "$input" | sed -e "s@yew = .*}@$replace@g")
if [[ "$input" == "$output" ]]; then
Expand All @@ -29,6 +31,11 @@ jobs:
fi
echo "$output" > frameworks/keyed/yew/Cargo.toml
echo "$output"
env:
# REPO_HTML_URL: ${{ github.event.pull_request.head.repo.html_url }}
REPO_HTML_URL: https://github.com/voidpumpkin/yew.git
# HEAD_REF: ${{ github.event.pull_request.head.ref }}
BRANCH: master

- name: Setup ChromeDriver
uses: nanasess/setup-chromedriver@master
Expand Down

0 comments on commit b886412

Please sign in to comment.