test: Add performance tests for CsObject conversion #246
Workflow file for this run
This file contains hidden or 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
# For more information see: | |
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Unit tests (CI) | |
on: | |
pull_request: | |
branches: ["main"] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
test: | |
strategy: | |
matrix: | |
# ref: https://github.com/actions/runner-images#readme | |
include: | |
# oldest combinations | |
- os: macos-13 | |
dotnet-version: "6.x" | |
python-version: "3.8" | |
- os: ubuntu-22.04 | |
dotnet-version: "6.x" | |
python-version: "3.8" | |
- os: windows-2019 | |
dotnet-version: "6.x" | |
python-version: "3.8" | |
# newest combinations | |
- os: macos-15 | |
dotnet-version: "9.x" | |
python-version: "3.13" | |
post-summary: true | |
- os: ubuntu-24.04-arm | |
dotnet-version: "9.x" | |
python-version: "3.13" | |
post-summary: true | |
- os: windows-2025 | |
dotnet-version: "9.x" | |
python-version: "3.13" | |
post-summary: true | |
runs-on: ${{ matrix.os }} | |
name: "Py${{ matrix.python-version }}/.NET${{ matrix.dotnet-version }} on ${{ matrix.os }}" | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Check debug settings | |
if: ${{ matrix.post-summary }} == 'true' | |
shell: bash | |
run: | | |
echo "Checking for debug logging settings in package files..." | |
# Use find and grep consistently across platforms | |
debug_files=$(find stock_indicators -type f -name "*.py" -exec grep -l '\bdebug[[:space:]]*=[[:space:]]*True\b' {} \;) | |
if [ ! -z "$debug_files" ]; then | |
echo "ERROR: Debug logging is still enabled in the following files:" | |
echo "$debug_files" | |
echo "Please set debug=False in configure_logging() calls before merging." | |
exit 1 | |
fi | |
echo "✓ No debug logging settings found." | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ matrix.dotnet-version }} | |
dotnet-quality: ga | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
- name: Verify DLL presence | |
if: startsWith(matrix.os, 'macos') | |
run: | | |
ls -la stock_indicators/_cslib/lib/ | |
if [ ! -f stock_indicators/_cslib/lib/Skender.Stock.Indicators.dll ]; then | |
echo "Skender.Stock.Indicators.dll is missing." | |
exit 1 | |
fi | |
chmod +r stock_indicators/_cslib/lib/Skender.Stock.Indicators.dll | |
- name: Install dependencies | |
run: | | |
pip install -U --upgrade-strategy=only-if-needed pip | |
pip install -r requirements.txt | |
pip install -r requirements-test.txt | |
- name: Test indicators | |
run: pytest -vr A tests --junitxml=test-results.xml | |
continue-on-error: true | |
- name: Post test summary | |
uses: test-summary/action@v2 | |
if: ${{ matrix.post-summary }} == 'true' | |
with: | |
paths: test-results.xml |