-
Notifications
You must be signed in to change notification settings - Fork 2
90 lines (83 loc) · 3.31 KB
/
run_benchmarks.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
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
name: Benchmarks
on: push
jobs:
Check_Pyccel_Version:
runs-on: ubuntu-latest
if: contains(github.event.head_commit.message, 'Benchmark of pyccel')
outputs:
new_version: ${{ steps.check_version.outputs.new_version }}
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install pyccel
run: |
python -m pip install --upgrade pip
python -m pip install wheel
python -m pip install pyccel
- name: Check Version
id: check_version
run: |
new_version=$(python -c "from pyccel import __version__; print(__version__)")
echo "new_version=${new_version}" >> $GITHUB_OUTPUT
Benchmark_main:
runs-on: ubuntu-latest
if: contains(github.event.head_commit.message, 'Benchmark of pyccel')
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
uses: ./.github/actions/linux_install
- name: Install development version of pyccel from GitHub
run: |
pip3 install 'pyccel @ git+https://github.com/pyccel/pyccel'
- name: Install python dependencies
run: |
pip3 install .
pip3 freeze > version_specific_results/devel_performance_310_requirements.txt
- name: Generate pyccel configs
uses: ./.github/actions/generate_pyccel_config
- name: Benchmark
run: |
cd benchmarks
python run_benchmarks.py --verbose --pyccel-config-files pyccel_fortran.json pyccel_c.json --pythran-config-files pythran.config
cd ..
FILE=version_specific_results/devel_performance_310.md
echo "### Performance Comparison (as of $(date))" > ${FILE}
cat benchmarks/bench.out >> ${FILE}
python analysis/plot_results_figures.py ${FILE}
shell: bash
working-directory: ./.
- name: Record Failure
run: echo "Devel branch benchmarks failed on python 3.10!" > version_specific_results/devel_performance_310.md
if: ${{ failure() }}
- name: Add & Commit
uses: EndBug/add-and-commit@v9
if: ${{ always() }}
with:
message: 'Update performance comparison'
add: "['version_specific_results/devel_performance_310.md', 'version_specific_results/devel_performance_310_compilation.svg', 'version_specific_results/devel_performance_310_execution.svg', 'version_specific_results/devel_performance_310_requirements.txt']"
default_author: github_actions
pull: '--rebase --autostash'
BuildReadme:
runs-on: ubuntu-latest
if: ${{ always() && contains(github.event.head_commit.message, 'Benchmark of pyccel')}}
needs: [ Check_Pyccel_Version, Benchmark_main]
steps:
- uses: actions/checkout@v3
- name: Write README
uses: ./.github/actions/create_readme
with:
version: "${{ needs.Check_Pyccel_Version.outputs.new_version }}"
- name: Add & Commit
uses: EndBug/add-and-commit@v9
with:
message: 'Update README and version'
add: "['README.md']"
default_author: github_actions
pull: '--rebase --autostash'