Skip to content

Commit bd9d6d1

Browse files
authored
🧪 TESTS: Improve benchmark testing (#33)
Also added tox testing configuration
1 parent b8ba4e3 commit bd9d6d1

File tree

83 files changed

+440
-536
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+440
-536
lines changed

.github/workflows/benchmark.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: benchmark
2+
3+
on:
4+
push:
5+
branches: [master]
6+
7+
jobs:
8+
benchmark-packages:
9+
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: Set up Python 3.8
15+
uses: actions/setup-python@v1
16+
with:
17+
python-version: 3.8
18+
19+
- name: install pandoc
20+
uses: r-lib/actions/setup-pandoc@v1
21+
with:
22+
pandoc-version: '2.6'
23+
24+
- name: Install tox
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install tox
28+
29+
- name: Run package benchmarks
30+
run: tox -e py38-bench-packages -- --benchmark-min-rounds 20 --benchmark-json bench-packages.json
31+
32+
# - name: Upload package data
33+
# uses: actions/upload-artifact@v2
34+
# with:
35+
# name: bench-packages
36+
# path: bench-packages.json
37+
# if-no-files-found: error
38+
39+
- name: Store benchmark result
40+
uses: chrisjsewell/github-action-benchmark@v2
41+
with:
42+
name: Parsing Benchmarks
43+
output-file-path: bench-packages.json
44+
github-token: ${{ secrets.GITHUB_TOKEN }}
45+
auto-push: true
46+
commit-msg-append: "[ci skip]"
47+
one-chart-groups: packages,plugins
48+
fail-on-alert: false
49+
50+
benchmark-plugins:
51+
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v2
55+
56+
- name: Set up Python 3.8
57+
uses: actions/setup-python@v1
58+
with:
59+
python-version: 3.8
60+
61+
- name: Install tox
62+
run: |
63+
python -m pip install --upgrade pip
64+
pip install tox
65+
66+
- name: Run plugin benchmarks
67+
run: tox -e py38-bench-plugins -- --benchmark-min-rounds 20 --benchmark-json bench-plugins.json
68+
69+
# - name: Upload plugin data
70+
# uses: actions/upload-artifact@v2
71+
# with:
72+
# name: bench-plugins
73+
# path: bench-plugins.json
74+
# if-no-files-found: error
75+
76+
- name: Store benchmark result
77+
uses: chrisjsewell/github-action-benchmark@v2
78+
with:
79+
name: Parsing Benchmarks
80+
output-file-path: bench-plugins.json
81+
# Use personal access token instead of GITHUB_TOKEN due to https://github.community/t5/GitHub-Actions/Github-action-not-triggering-gh-pages-upon-push/td-p/26869/highlight/false
82+
github-token: ${{ secrets.GITHUB_TOKEN }}
83+
auto-push: true
84+
commit-msg-append: "[ci skip]"
85+
one-chart-groups: packages,plugins
86+
# Show alert with commit comment on detecting possible performance regression
87+
alert-threshold: '200%'
88+
comment-on-alert: true
89+
fail-on-alert: false
90+
alert-comment-cc-users: '@chrisjsewell'

.github/workflows/tests.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,32 @@ jobs:
5353
file: ./coverage.xml
5454
fail_ci_if_error: true
5555

56+
benchmark:
57+
58+
runs-on: ubuntu-latest
59+
steps:
60+
- uses: actions/checkout@v2
61+
62+
- name: Set up Python 3.8
63+
uses: actions/setup-python@v1
64+
with:
65+
python-version: 3.8
66+
67+
- name: Install tox
68+
run: |
69+
python -m pip install --upgrade pip
70+
pip install tox
71+
72+
- name: Run benchmark
73+
run: tox -e py38-bench-core -- --benchmark-json bench-core.json
74+
75+
- name: Upload data
76+
uses: actions/upload-artifact@v2
77+
with:
78+
name: bench-core
79+
path: bench-core.json
80+
if-no-files-found: error
81+
5682
publish:
5783

5884
name: Publish to PyPi

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ exclude: >
99
test.*\.html|
1010
.*commonmark\.json|
1111
benchmark/.*\.md|
12-
markdown\_it/cli/spec\.md
12+
.*/spec\.md
1313
)$
1414
1515
repos:

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
include LICENSE
2-
include markdown_it/cli/spec.md

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,6 @@ Also [John MacFarlane](https://github.com/jgm) for his work on the CommonMark sp
101101
[CommonMark spec]: http://spec.commonmark.org/
102102
[markdown-it]: https://github.com/markdown-it/markdown-it
103103
[markdown-it-readme]: https://github.com/markdown-it/markdown-it/blob/master/README.md
104-
[md-security]: https://github.com/ExecutableBookProject/markdown-it-py/tree/master/docs/security.md
105-
[md-performance]: https://markdown-it-py.readthedocs.io/en/latest/security.html
104+
[md-security]: https://markdown-it-py.readthedocs.io/en/latest/other.html
105+
[md-performance]: https://markdown-it-py.readthedocs.io/en/latest/other.html
106106
[md-plugins]: https://markdown-it-py.readthedocs.io/en/latest/plugins.html

benchmark_samples/README.md

Lines changed: 0 additions & 254 deletions
This file was deleted.

0 commit comments

Comments
 (0)