Merge pull request #14 from wey-gu/decouple_more #52
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
| name: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| tags: [ 'v*' ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13"] | |
| node-version: ["22"] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Set up Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev]" | |
| pip install types-psutil | |
| - name: Run stable tests and examples | |
| run: | | |
| python scripts/dev.py | |
| env: | |
| PYTHONPATH: . | |
| - name: Generate coverage report for codecov | |
| if: matrix.python-version == '3.11' | |
| run: | | |
| pip install coverage[toml] pytest-cov | |
| pytest tests/ examples/ --cov=py_pglite --cov-report=xml --cov-report=term-missing --ignore=examples/testing-patterns/test_performance_benchmarks.py -k "not test_custom_configuration_patterns" | |
| - name: Run stress tests (optional) | |
| continue-on-error: true | |
| if: matrix.python-version == '3.11' | |
| run: | | |
| python scripts/dev.py --stress | |
| - name: Upload coverage to Codecov | |
| if: matrix.python-version == '3.11' | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| fail_ci_if_error: true | |
| files: ./coverage.xml | |
| name: codecov-umbrella | |
| verbose: true | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| test-package: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| - name: Test package installation | |
| run: | | |
| python -m pip install --upgrade pip build | |
| python -m build | |
| pip install dist/*.whl | |
| - name: Test installed package | |
| run: | | |
| python -c "import py_pglite; print(f'Successfully imported py-pglite {py_pglite.__version__}')" | |
| python -c "from py_pglite import PGliteManager, PGliteConfig; print('All imports working')" | |
| security: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install safety bandit[toml] | |
| - name: Run Safety CLI to check for vulnerabilities | |
| uses: pyupio/safety-action@v1 | |
| with: | |
| api-key: ${{ secrets.SAFETY_API_KEY }} | |
| - name: Security scan with Bandit | |
| run: | | |
| bandit -r py_pglite/ -c .bandit -f json -o bandit-report.json || true | |
| bandit -r py_pglite/ -c .bandit |