fix: skip cloudpickle tests when not installed #14
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] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev]" | |
| - name: Lint with ruff | |
| run: | | |
| ruff check src/ tests/ | |
| - name: Type check with mypy | |
| run: | | |
| mypy src/ | |
| - name: Run tests with coverage | |
| run: | | |
| pytest tests/ -v --cov=agent_airlock --cov-report=xml --cov-report=term-missing --cov-fail-under=80 | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| file: ./coverage.xml | |
| fail_ci_if_error: false | |
| - name: Generate coverage badge | |
| if: matrix.python-version == '3.11' && github.ref == 'refs/heads/main' | |
| run: | | |
| pip install coverage-badge | |
| coverage-badge -o coverage.svg -f | |
| lint: | |
| 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 ruff | |
| run: pip install ruff | |
| - name: Check formatting | |
| run: ruff format --check src/ tests/ | |
| 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 security tools | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install bandit safety cyclonedx-bom | |
| - name: Run Bandit security scan | |
| run: bandit -r src/agent_airlock/ -f txt | |
| - name: Run Safety dependency check | |
| run: pip freeze | safety check --stdin | |
| continue-on-error: true # Don't fail on deprecation warnings | |
| - name: Generate SBOM | |
| run: | | |
| pip install -e . | |
| cyclonedx-py environment --pyproject pyproject.toml --output-format JSON -o sbom.json --mc-type library | |
| - name: Upload SBOM | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sbom | |
| path: sbom.json |