Skip to content

Commit a3e6017

Browse files
committed
Add benchmark action and publish it to gh-pages
Experimenting not using GPO Use vanilla git command to publish Do not run benchmark in matrix Skip chatty test case discovery during benchmark
1 parent 45d7682 commit a3e6017

File tree

2 files changed

+30
-5
lines changed

2 files changed

+30
-5
lines changed

.github/workflows/python-package.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,40 @@ jobs:
4242
python -m pip install --upgrade pip
4343
python -m pip install flake8 pytest
4444
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
45+
- name: Test with pytest
46+
run: pytest --benchmark-skip
4547
- name: Lint with flake8
4648
run: |
4749
# stop the build if there are Python syntax errors or undefined names
4850
#flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
4951
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
5052
#flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
51-
- name: Test with pytest
53+
54+
cb:
55+
# Benchmark only after the correctness has been tested by CI,
56+
# and then run benchmark only once (sampling with only one Python version).
57+
needs: ci
58+
runs-on: ubuntu-latest
59+
steps:
60+
- uses: actions/checkout@v2
61+
- name: Set up Python 3.9
62+
uses: actions/setup-python@v2
63+
with:
64+
python-version: 3.9
65+
- name: Install dependencies
5266
run: |
53-
pytest
67+
python -m pip install --upgrade pip
68+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
69+
- name: Run benchmark
70+
run: pytest --benchmark-only --benchmark-json benchmark.json --log-cli-level INFO tests/test_benchmark.py
71+
- name: Render benchmark result
72+
uses: benchmark-action/github-action-benchmark@v1
73+
with:
74+
tool: 'pytest'
75+
output-file-path: benchmark.json
76+
fail-on-alert: true
77+
- name: Publish Gibhub Pages
78+
run: git push origin gh-pages
5479

5580
cd:
5681
needs: ci

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Microsoft Authentication Library (MSAL) for Python
22

3-
| `dev` branch | Reference Docs | # of Downloads per different platforms | # of Downloads per recent MSAL versions |
4-
|---------------|---------------|----------------------------------------|-----------------------------------------|
5-
[![Build status](https://github.com/AzureAD/microsoft-authentication-library-for-python/actions/workflows/python-package.yml/badge.svg?branch=dev)](https://github.com/AzureAD/microsoft-authentication-library-for-python/actions) | [![Documentation Status](https://readthedocs.org/projects/msal-python/badge/?version=latest)](https://msal-python.readthedocs.io/en/latest/?badge=latest) | [![Downloads](https://pepy.tech/badge/msal)](https://pypistats.org/packages/msal) | [![Download monthly](https://pepy.tech/badge/msal/month)](https://pepy.tech/project/msal)
3+
| `dev` branch | Reference Docs | # of Downloads per different platforms | # of Downloads per recent MSAL versions | Benchmark Diagram |
4+
|:------------:|:--------------:|:--------------------------------------:|:---------------------------------------:|:-----------------:|
5+
[![Build status](https://github.com/AzureAD/microsoft-authentication-library-for-python/actions/workflows/python-package.yml/badge.svg?branch=dev)](https://github.com/AzureAD/microsoft-authentication-library-for-python/actions) | [![Documentation Status](https://readthedocs.org/projects/msal-python/badge/?version=latest)](https://msal-python.readthedocs.io/en/latest/?badge=latest) | [![Downloads](https://static.pepy.tech/badge/msal)](https://pypistats.org/packages/msal) | [![Download monthly](https://static.pepy.tech/badge/msal/month)](https://pepy.tech/project/msal) | [📉](https://azuread.github.io/microsoft-authentication-library-for-python/dev/bench/)
66

77
The Microsoft Authentication Library for Python enables applications to integrate with the [Microsoft identity platform](https://aka.ms/aaddevv2). It allows you to sign in users or apps with Microsoft identities ([Azure AD](https://azure.microsoft.com/services/active-directory/), [Microsoft Accounts](https://account.microsoft.com) and [Azure AD B2C](https://azure.microsoft.com/services/active-directory-b2c/) accounts) and obtain tokens to call Microsoft APIs such as [Microsoft Graph](https://graph.microsoft.io/) or your own APIs registered with the Microsoft identity platform. It is built using industry standard OAuth2 and OpenID Connect protocols
88

0 commit comments

Comments
 (0)