Repository navigation
Merge pull request #276 from CoreTrace/fix/264-namespace-modules #690
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: | |
| pull_request: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - run: python -m pip install -e ".[dev]" | |
| - run: python -m mypy | |
| - run: python -m ruff check . | |
| - run: python -m pytest | |
| regression: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - uses: actions/cache@v4 | |
| with: | |
| path: .regression | |
| key: regression-${{ hashFiles('tests/regression/repositories.toml') }} | |
| - run: python -m pip install -e ".[dev]" | |
| - run: python -m pytest -m regression | |
| package: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - run: python -m pip install build twine | |
| - run: python -m build | |
| - run: python -m twine check dist/* | |
| - name: Install the wheel in a clean environment and run a check | |
| run: | | |
| python -m venv /tmp/smoke | |
| /tmp/smoke/bin/pip install dist/*.whl | |
| printf 'def run(code):\n eval(code)\n' > /tmp/sample.py | |
| /tmp/smoke/bin/coretrace-python-analyzer --check /tmp/sample.py --format json > /tmp/report.json || test $? -eq 1 | |
| grep -q '"rule_id": "dangerous-eval"' /tmp/report.json | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/ |