tests galore #1
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, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.8", "3.9", "3.10", "3.11"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v2 | |
| - name: Install dependencies | |
| run: | | |
| uv sync --dev | |
| - name: Run unit tests | |
| run: | | |
| uv run pytest tests/unit/ -v --cov=bytewaves --cov-report=xml --cov-report=term-missing | |
| - name: Run integration tests | |
| run: | | |
| uv run pytest tests/integration/ -v --cov=bytewaves --cov-report=xml --cov-report=term-missing --cov-append | |
| - name: Run performance tests | |
| run: | | |
| uv run pytest tests/performance/ -v --cov=bytewaves --cov-report=xml --cov-report=term-missing --cov-append | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| file: ./coverage.xml | |
| flags: unittests | |
| name: codecov-umbrella | |
| fail_ci_if_error: false | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.11" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v2 | |
| - name: Install dependencies | |
| run: | | |
| uv sync --dev | |
| - name: Lint with flake8 | |
| run: | | |
| uv run flake8 bytewaves/ --count --select=E9,F63,F7,F82 --show-source --statistics | |
| uv run flake8 bytewaves/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
| - name: Check formatting with black | |
| run: | | |
| uv run black --check --diff bytewaves/ | |
| security: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.11" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v2 | |
| - name: Install dependencies | |
| run: | | |
| uv sync | |
| - name: Run safety check | |
| run: | | |
| uv run safety check | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: [test, lint, security] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.11" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v2 | |
| - name: Build package | |
| run: | | |
| uv build | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ |