forked from django/django
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (54 loc) · 1.69 KB
/
benchmark.yml
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
name: Benchmark
on:
workflow_dispatch:
schedule:
- cron: '0 0,5 * * *'
pull_request:
types: [ labeled, synchronize, opened, reopened ]
permissions:
contents: read
jobs:
Run_benchmarks:
#if: contains(github.event.pull_request.labels.*.name, 'benchmark')
runs-on: ubuntu-latest
steps:
- name: Eco-CI Init
uses: green-coding-berlin/eco-ci-energy-estimation@v2
with:
task: start-measurement
- name: Checkout Benchmark Repo
uses: actions/checkout@v4
with:
repository: django/django-asv
path: "."
- name: Install Requirements
run: pip install -r requirements.txt
- name: Cache Django
uses: actions/cache@v3
with:
path: Django/*
key: Django
- name: Run Benchmarks
shell: bash -l {0}
run: |-
asv machine --machine ubuntu-latest --yes > /dev/null
echo 'Beginning benchmarks...'
asv continuous --interleave-processes -a processes=2 --split --show-stderr 'HEAD^' 'HEAD' |\
sed -n -E '/(before.*after.*ratio)|(BENCHMARKS)/,$p' >> out.txt
echo 'Benchmarks Done.'
echo '```' >> $GITHUB_STEP_SUMMARY
cat out.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
if grep -q "PERFORMANCE DECREASED" out.txt;
then
exit 1
fi
- name: Eco-CI Measurement
uses: green-coding-berlin/eco-ci-energy-estimation@v2
with:
task: get-measurement
label: 'benchmark'
- name: Eco-CI Results
uses: green-coding-berlin/eco-ci-energy-estimation@v2
with:
task: display-results