-
Notifications
You must be signed in to change notification settings - Fork 33
187 lines (155 loc) · 6.34 KB
/
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
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
name: benchmarks
on: [pull_request]
concurrency:
group: ${{ github.actor }}-${{ github.ref }}-benchmarks
cancel-in-progress: true
jobs:
benchmarks:
strategy:
fail-fast: false
matrix:
benchmark_number: [1,2,3,4,5,6,7,8]
include:
- benchmark_number: 1
benchmark_name: 'slab_interpolation_simple_none'
benchmark_gridfile: 'cartesian_subducting_plate_gridfile'
- benchmark_number: 2
benchmark_name: 'slab_interpolation_simple_curved_none'
benchmark_gridfile: 'cartesian_subducting_plate_gridfile'
- benchmark_number: 3
benchmark_name: 'spherical_slab_interpolation_simple_none'
benchmark_gridfile: 'spherical_subducting_plate_gridfile'
- benchmark_number: 4
benchmark_name: 'slab_interpolation_simple_curved_CMS'
benchmark_gridfile: 'cartesian_subducting_plate_gridfile'
- benchmark_number: 5
benchmark_name: 'spherical_slab_interpolation_simple_CMS'
benchmark_gridfile: 'spherical_subducting_plate_gridfile'
- benchmark_number: 6
benchmark_name: 'spherical_fault_interpolation_simple_none'
benchmark_gridfile: 'spherical_subducting_plate_gridfile'
- benchmark_number: 7
benchmark_name: 'continental_min_max_surface'
benchmark_gridfile: 'cartesian_surface'
- benchmark_number: 8
benchmark_name: 'continental_min_max_surface_spherical'
benchmark_gridfile: 'spherical_surface_p180'
runs-on: ubuntu-latest
steps:
- name: Setup cmake
uses: jwlawson/[email protected]
with:
cmake-version: '3.16.x'
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: cmake version
run: cmake --version
- name: Checkout cbdr
uses: actions/checkout@v2
with:
repository: MFraters/cbdr
ref: github_actions_fix
path: cbdr
- name: retrieve cache cbdr
uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/git/
target/
./target/
${{github.workspace}}/cbdr/
${{github.workspace}}/cbdr/target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: retrieve cache main
uses: actions/cache@v2
with:
path: |
${{github.workspace}}/main/
key: ${{ runner.os }}-gwb-main-v3}}
- name: retrieve cache feature
uses: actions/cache@v2
with:
path: |
${{github.workspace}}/feature/
key: ${{ runner.os }}-gwb-feature-${{ github.event.number }}-v3}}
- name: Checkout cbdr
uses: actions/checkout@v2
with:
repository: MFraters/cbdr
ref: github_actions_fix
path: cbdr
clean: false
- name: Checkout feature
uses: actions/checkout@v2
with:
path: feature/source
clean: false
- name: Checkout main
uses: actions/checkout@v2
with:
ref: main
path: main/source
clean: false
- name: cd Build Environment
run: |
cd ${{github.workspace}}/cbdr/;
cargo build --release;
- name: Create Build Environment
run: |
sudo apt install ninja-build;
cmake -E make_directory ${{github.workspace}}/main/build;
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/main/build
run: |
pwd;
ls;
cmake -G"Ninja" $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-Werror -DWB_INCLUDE_UNIT_TEST=OFF ${{github.workspace}}/main/source/;
- name: Build gwb
working-directory: ${{github.workspace}}/main/build
shell: bash
run: ninja
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/feature/build
- name: cd Build Environment
run: cd ${{github.workspace}}/feature/build;
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/feature/build
run: |
pwd;
ls;
cmake -G"Ninja" $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-Werror -DWB_INCLUDE_UNIT_TEST=OFF ${{github.workspace}}/feature/source/;
- name: Build gwb
working-directory: ${{github.workspace}}/feature/build
shell: bash
run: ninja
- name: make results dir
shell: bash
run: |
rm -rf ${{github.workspace}}/benchmark_${{matrix.benchmark_number}}_results/;
mkdir -p ${{github.workspace}}/benchmark_${{matrix.benchmark_number}}_results/
- name: store pull request number
shell: bash
if: matrix.benchmark_number == 1
run: |
echo "${{matrix.benchmark_number}}";
echo "${{ github.event.number }}" > ${{github.workspace}}/benchmark_${{matrix.benchmark_number}}_results/NR
- name: run benchmark
shell: bash
run: |
cd ${{github.workspace}}/cbdr/;
time cargo run --release sample --timeout=900s "main:${{github.workspace}}/main/build/bin/./gwb-grid ${{github.workspace}}/feature/source/tests/gwb-dat/${{matrix.benchmark_name}}.wb ${{github.workspace}}/feature/source/tests/gwb-grid/${{matrix.benchmark_gridfile}}.grid" "feature:${{github.workspace}}/feature/build/bin/./gwb-grid ${{github.workspace}}/feature/source/tests/gwb-dat/${{matrix.benchmark_name}}.wb ${{github.workspace}}/feature/source/tests/gwb-grid/${{matrix.benchmark_gridfile}}.grid" > ${{github.workspace}}/result_${{matrix.benchmark_number}}.csv;
cat ${{github.workspace}}/result_${{matrix.benchmark_number}}.csv;
cat ${{github.workspace}}/result_${{matrix.benchmark_number}}.csv | cargo run --release analyze --disable-dynamic-printing > ${{github.workspace}}/benchmark_${{matrix.benchmark_number}}_results/analyze_${{matrix.benchmark_number}}.log ||:;
cat ${{github.workspace}}/benchmark_${{matrix.benchmark_number}}_results/analyze_${{matrix.benchmark_number}}.log
- uses: actions/upload-artifact@v2
with:
name: benchmark_${{matrix.benchmark_number}}_results
path: benchmark_${{matrix.benchmark_number}}_results/