diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 0571b6b..53f9499 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -2,49 +2,61 @@ name: CI on: push: - branches: [main] + branches: [main, master] pull_request: - branches: [main] + branches: [main, master] jobs: test: runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.9", "3.10", "3.11"] + steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -e ".[dev]" + pip install -e . - - name: Run pytest - run: pytest tests/ -v + - name: Run unit tests + run: pytest tests/unit/ -v - - name: Run ruff linter - run: ruff check . + - name: Run integration tests + run: pytest tests/integration/ -v - - name: Run black formatter check - run: black --check api_testgen/ + - name: Run tests with coverage + run: python -m pytest tests/ --cov=api_testgen - build: + - name: Upload coverage report + uses: codecov/codecov-action@v4 + with: + files: ./coverage.xml + fail_ci_if_error: false + + lint: runs-on: ubuntu-latest + steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - name: Set up Python + uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: "3.11" - - name: Build package - run: | - pip install build - python -m build + - name: Install linting tools + run: pip install ruff mypy - - name: Verify package - run: | - pip install dist/*.whl - api-testgen --help + - name: Run ruff + run: ruff check . + + - name: Run mypy + run: mypy api_testgen/ --ignore-missing-imports