-
Notifications
You must be signed in to change notification settings - Fork 341
140 lines (116 loc) · 4 KB
/
benchmark.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# Run resolving benchmark and store results. Fail if any resolved runtimes
# change from previous result
#
name: benchmark
on:
release:
types: [released]
pull_request:
types: [opened, synchronize, reopened, labeled]
jobs:
run_benchmark:
name: run_benchmark
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' || contains(github.event.pull_request.labels.*.name, 'run-benchmarks') }}
strategy:
matrix:
python-version:
- '3.7'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup python ${{ matrix.python-version }}
uses: ./.github/actions/setup-python
with:
python-version: ${{ matrix.python-version }}
os: ubuntu-latest
- name: Install Rez
run: |
mkdir ./installdir
python ./install.py ./installdir
- name: Run Benchmark
run: |
./installdir/bin/rez/rez-benchmark --out ./out
# remove benchmarking suite package repo
rm -rf ./out/packages
- name: Validate Result
run: |
python ./.github/scripts/validate_benchmark.py
- uses: actions/upload-artifact@v4
with:
name: "benchmark-result-${{ matrix.python-version }}"
path: ./out
store_benchmark_result:
name: store_benchmark_result
runs-on: ubuntu-latest
needs: run_benchmark
strategy:
matrix:
python-version:
- '3.7'
# so we don't have jobs trying to push to git at the same time
max-parallel: 1
steps:
- uses: actions/download-artifact@v3
with:
name: "benchmark-result-${{ matrix.python-version }}"
path: .
- name: Checkout (release)
uses: actions/checkout@v4
if: ${{ github.event_name =='release' }}
with:
ref: main
path: src
# This is a PAT from an Admin user. We do this in order to be able to write to a
# protected branch (main) from this workflow.
# See https://github.community/t/how-to-push-to-protected-branches-in-a-github-action/16101/14
#
# Disable for now until we find a better solution.
# token: "${{ secrets.GH_ACTION_TOKEN }}"
- name: Checkout (pr)
uses: actions/checkout@v4
if: ${{ github.event_name !='release' }}
with:
path: src
- name: Setup python ${{ matrix.python-version }}
uses: ./src/.github/actions/setup-python
with:
python-version: ${{ matrix.python-version }}
os: ubuntu-latest
# Note failing due to
# https://github.com/actions/virtual-environments/issues/675
#
# We'll just skip on failure, this just means the gnuplot doesn't render
#
- name: Install gnuplot
run: |
sudo apt-get update
sudo apt-get install -y gnuplot || /bin/true
- name: Store Benchmark Result
run: |
python ./.github/scripts/store_benchmark.py
working-directory: src
- name: Create summary
run: |
echo '<details>' >> $GITHUB_STEP_SUMMARY
echo '<summary>Results</summary>' >> $GITHUB_STEP_SUMMARY
cat metrics/benchmarking/RESULTS.md >> $GITHUB_STEP_SUMMARY
echo '</details>' >> $GITHUB_STEP_SUMMARY
working-directory: src
# - name: Setup git config
# if: ${{ github.event_name == 'release' }}
# run: |
# git config user.name 'github-actions[bot]'
# git config user.email 'github-actions[bot]@users.noreply.github.com'
# working-directory: src
# - name: Git commit and push
# if: ${{ github.event_name == 'release' }}
# run: |
# if [[ "$(git status --porcelain)" == "" ]]; then
# echo "Nothing new to commit"
# else
# git add --all
# git commit -m "Generated from GitHub "${{ github.workflow }}" Workflow"
# git push origin main
# fi
# working-directory: src