Skip to content

Commit c713097

Browse files
authored
save benchmarks on master branch only (#50)
Benchmarks should only be saved on builds for the master branch (otherwise a non-accepted PR would overwrite the current stats).
1 parent 754570b commit c713097

File tree

2 files changed

+58
-35
lines changed

2 files changed

+58
-35
lines changed

.github/workflows/benchmarks.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
#
18+
name: Benchmarks
19+
20+
on:
21+
push:
22+
branches: [master]
23+
24+
jobs:
25+
Benchmarks:
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- uses: actions/checkout@v3
30+
with:
31+
fetch-depth: 0
32+
- name: Install python
33+
uses: actions/setup-python@v2
34+
with:
35+
python-version: 3.8
36+
- name: Install Ray Beam Runner
37+
run: |
38+
pip install -e .[test]
39+
- name: Install dependencies
40+
run: |
41+
python -m pip install --upgrade pip
42+
pip install -r requirements_dev.txt
43+
pip install -U "ray @ https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-3.0.0.dev0-cp38-cp38-manylinux2014_x86_64.whl"
44+
- name: Run Benchmark
45+
run: |
46+
pytest benchmark/simple.py --benchmark-only --benchmark-json bm-result.json
47+
- name: Store benchmark result
48+
uses: benchmark-action/github-action-benchmark@v1
49+
with:
50+
name: Python Benchmark with pytest-benchmark
51+
tool: 'pytest'
52+
output-file-path: bm-result.json
53+
github-token: ${{ secrets.GITHUB_TOKEN }}
54+
auto-push: true
55+
# Show alert with commit comment on detecting possible performance regression
56+
alert-threshold: '200%'
57+
comment-on-alert: true
58+
fail-on-alert: true

.github/workflows/ci.yml

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -46,41 +46,6 @@ jobs:
4646
run: |
4747
bash scripts/format.sh
4848
49-
Benchmarks:
50-
runs-on: ubuntu-latest
51-
52-
steps:
53-
- uses: actions/checkout@v3
54-
with:
55-
fetch-depth: 0
56-
- name: Install python
57-
uses: actions/setup-python@v2
58-
with:
59-
python-version: 3.8
60-
- name: Install Ray Beam Runner
61-
run: |
62-
pip install -e .[test]
63-
- name: Install dependencies
64-
run: |
65-
python -m pip install --upgrade pip
66-
pip install -r requirements_dev.txt
67-
pip install -U "ray @ https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-3.0.0.dev0-cp38-cp38-manylinux2014_x86_64.whl"
68-
- name: Run Benchmark
69-
run: |
70-
pytest benchmark/simple.py --benchmark-only --benchmark-json bm-result.json
71-
- name: Store benchmark result
72-
uses: benchmark-action/github-action-benchmark@v1
73-
with:
74-
name: Python Benchmark with pytest-benchmark
75-
tool: 'pytest'
76-
output-file-path: bm-result.json
77-
github-token: ${{ secrets.GITHUB_TOKEN }}
78-
auto-push: false
79-
# Show alert with commit comment on detecting possible performance regression
80-
alert-threshold: '200%'
81-
comment-on-alert: true
82-
fail-on-alert: true
83-
8449
Tests:
8550
runs-on: ubuntu-latest
8651
strategy:

0 commit comments

Comments
 (0)