-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Add CodSpeed to follow lib performance
- Loading branch information
Showing
17 changed files
with
227 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,8 @@ on: | |
- feat/* | ||
- hotfix/* | ||
- main | ||
# Allows CodSpeed to trigger backtest performance analysis in order to generate initial data | ||
workflow_dispatch: | ||
|
||
jobs: | ||
init: | ||
|
@@ -52,7 +54,8 @@ jobs: | |
# Run all test suites | ||
step: | ||
- static | ||
- unit | ||
- unit-simple | ||
- unit-codspeed | ||
# Run on all supported Python versions | ||
python-version: | ||
- "3.11" | ||
|
@@ -103,9 +106,17 @@ jobs: | |
- name: Configure environment variables | ||
run: echo "${{ secrets.DOTENV_UNIT_TESTS }}" > .env | ||
|
||
- name: Run tests | ||
- name: Run tests (simple) | ||
if: ${{ !contains(matrix.step, 'codspeed') }} | ||
run: make test-${{ matrix.step }} version_full=${{ needs.init.outputs.VERSION_FULL }} | ||
|
||
- name: Run tests (CodSpeed) | ||
if: ${{ contains(matrix.step, 'codspeed') }} | ||
uses: CodSpeedHQ/[email protected] | ||
with: | ||
token: ${{ secrets.CODSPEED_TOKEN }} | ||
run: make test-${{ matrix.step }} version_full=${{ needs.init.outputs.VERSION_FULL }} | ||
|
||
- name: Upload artifacts | ||
uses: actions/[email protected] | ||
if: always() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -291,3 +291,6 @@ test-reports/ | |
# Local .env | ||
!.env.example | ||
.env.* | ||
|
||
# CodSpeed | ||
.codspeed/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
from os import environ as env | ||
|
||
from dotenv import find_dotenv, load_dotenv | ||
|
||
# First, load the environment variables from the .env file | ||
load_dotenv( | ||
find_dotenv( | ||
# Use the current working directory from where the command is run | ||
usecwd=True, | ||
) | ||
) | ||
|
||
# Detect if the code is running in a CI environment | ||
# See: https://stackoverflow.com/a/75223617 | ||
IS_CI = env.get("CI", "").lower() == "true" | ||
if IS_CI: | ||
print("CI environment detected, be aware configuration may differ") # noqa: T201 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.