improved metrics #5
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
| """GitHub Actions CI/CD configuration.""" | ||
| name: CI | ||
| on: | ||
| push: | ||
| branches: [main, develop] | ||
| pull_request: | ||
| branches: [main, develop] | ||
| jobs: | ||
| lint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: "3.11" | ||
| - name: Install Poetry | ||
| uses: snok/install-poetry@v1 | ||
| with: | ||
| version: 1.7.0 | ||
| - name: Install dependencies | ||
| run: | | ||
| poetry install --no-interaction | ||
| - name: Run ruff | ||
| run: | | ||
| poetry run ruff check . | ||
| - name: Run mypy | ||
| run: | | ||
| poetry run mypy . --ignore-missing-imports | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python-version: ["3.11", "3.12"] | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Install Poetry | ||
| uses: snok/install-poetry@v1 | ||
| with: | ||
| version: 1.7.0 | ||
| - name: Install dependencies | ||
| run: | | ||
| poetry install --no-interaction | ||
| - name: Run tests | ||
| run: | | ||
| poetry run pytest -v --cov=. --cov-report=xml | ||
| env: | ||
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
| - name: Upload coverage | ||
| uses: codecov/codecov-action@v3 | ||
| with: | ||
| file: ./coverage.xml | ||
| fail_ci_if_error: false | ||
| integration: | ||
| runs-on: ubuntu-latest | ||
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: "3.11" | ||
| - name: Install Poetry | ||
| uses: snok/install-poetry@v1 | ||
| with: | ||
| version: 1.7.0 | ||
| - name: Install dependencies | ||
| run: | | ||
| poetry install --no-interaction --with tools | ||
| - name: Install analysis tools | ||
| run: | | ||
| pip install semgrep bandit | ||
| - name: Run integration tests | ||
| run: | | ||
| poetry run pytest tests/e2e/ -v | ||
| env: | ||
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||