-
-
Notifications
You must be signed in to change notification settings - Fork 117
94 lines (85 loc) · 3.11 KB
/
performance.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
# This workflow builds a map using the base and branch commit of a PR and uploads
# the logs as an artifact that update-pr.yml uses to add back as a comment.
name: Performance
on:
pull_request:
branches: [ main ]
env:
# For performance tests, run this branch against main with:
AREA: rhode island
RAM: 4g
# Also pick up a good chunk of the atlantic ocean to catch any regressions in repeated tile performance
# Omit to infer from .osm.pbf bounds
BOUNDS_ARG: "--bounds=-74.07,21.34,-17.84,43.55"
jobs:
performance:
name: Performance Test
runs-on: ubuntu-latest
timeout-minutes: 20
continue-on-error: true
steps:
- name: 'Cancel previous runs'
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: 'Checkout branch'
uses: actions/checkout@v4
with:
path: branch
submodules: true
- name: 'Checkout base'
uses: actions/checkout@v4
with:
path: base
ref: ${{ github.event.pull_request.base.sha }}
submodules: true
- name: Cache data/sources
uses: ./branch/.github/cache-sources-action
with:
basedir: branch
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
- uses: actions/setup-node@v4
with:
node-version: '14'
- run: npm install -g [email protected]
- name: 'Build branch'
run: ./scripts/build.sh
working-directory: branch
- name: 'Build base'
run: ./scripts/build.sh
working-directory: base
- name: 'Download data'
run: |
set -eo pipefail
cp base/planetiler-dist/target/*with-deps.jar run.jar && java -jar run.jar --only-download --area="${{ env.AREA }}"
cp branch/planetiler-dist/target/*with-deps.jar run.jar && java -jar run.jar --only-download --area="${{ env.AREA }}"
- name: 'Store build info'
run: |
mkdir build-info
echo "${{ github.event.pull_request.base.sha }}" > build-info/base_sha
echo "${{ github.sha }}" > build-info/branch_sha
echo "${{ github.event.number }}" > build-info/pull_request_number
- name: 'Run branch'
run: |
rm -rf data/out.mbtiles data/tmp
cp branch/planetiler-dist/target/*with-deps.jar run.jar
java -Xms${{ env.RAM }} -Xmx${{ env.RAM }} -jar run.jar --area="${{ env.AREA }}" "${{ env.BOUNDS_ARG }}" --output=data/out.mbtiles --keep-unzipped 2>&1 | tee log
ls -alh run.jar | tee -a log
cat log | strip-ansi > build-info/branchlogs.txt
- name: 'Run base'
run: |
rm -rf data/out.mbtiles data/tmp
cp base/planetiler-dist/target/*with-deps.jar run.jar
java -Xms${{ env.RAM }} -Xmx${{ env.RAM }} -jar run.jar --area="${{ env.AREA }}" "${{ env.BOUNDS_ARG }}" --output=data/out.mbtiles --keep-unzipped 2>&1 | tee log
ls -alh run.jar | tee -a log
cat log | strip-ansi > build-info/baselogs.txt
- name: 'Upload build-info'
uses: actions/upload-artifact@v3
with:
name: build-info
path: ./build-info