-
-
Notifications
You must be signed in to change notification settings - Fork 27
70 lines (60 loc) · 2.22 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
61
62
63
64
65
66
67
68
69
70
name: benchmark
on:
workflow_dispatch:
pull_request:
branches:
- main
jobs:
do-benchmark:
if: github.event.pull_request.merged == false
name: Benchmark runner
runs-on: ubuntu-latest
container: docker://dvcorg/cml-py3:latest
steps:
- name: Checkout folder to get test files
uses: actions/checkout@v3
if: github.event_name == 'pull_request'
with:
fetch-depth: 0
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- uses: actions/checkout@v3
if: github.event_name == 'push'
with:
fetch-depth: 0
- name: Rename checked out topojson package
run: mv topojson do_later_topojson
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
python -m pip install geopandas numpy fire altair vl-convert-python
- name: Install latest topojson version from pypi
run: python -m pip install topojson
- name: Benchmark last released version!
run: python tests/benchmark_compute.py --version=last-released
- name: Install main repo topojson from git
run: python -m pip install git+https://github.com/mattijn/topojson.git --upgrade
- name: Benchmark version in github main!
run: python tests/benchmark_compute.py --version=main
- name: Rename moved topojson package
run: mv do_later_topojson topojson
- name: Benchmark this PR!
run: python tests/benchmark_compute.py --version=PR
- name: Create visz from benchmark results!
run: python tests/benchmark_visz.py
- name: Generate benchmart as report
env:
repo_token: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "## Benchmark result" > benchmark.md
cml-publish tests/benchmark_chart.png --md >> benchmark.md
cml-send-comment benchmark.md
- name: Upload benchmark png as artifact
uses: actions/upload-artifact@v3
with:
name: benchmark-artifact
path: tests/benchmark_chart.png