Skip to content

Potential fix for code scanning alert no. 57: Workflow does not conta… #2

Potential fix for code scanning alert no. 57: Workflow does not conta…

Potential fix for code scanning alert no. 57: Workflow does not conta… #2

Workflow file for this run

name: Tests
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
permissions:
contents: read
jobs:
test:
name: Run Tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.10.x', '3.11.x']
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/Library/Caches/pip
~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: pip install -e .[dev]
- name: Run tests with pytest
run: pytest tests/ -v --tb=short
- name: Test summary
if: always()
run: |
echo "## Test Results :test_tube:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **OS**: ${{ matrix.os }}" >> $GITHUB_STEP_SUMMARY
echo "- **Python**: ${{ matrix.python-version }}" >> $GITHUB_STEP_SUMMARY