diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml index 7eea847..254f720 100644 --- a/.github/workflows/pull_request.yaml +++ b/.github/workflows/pull_request.yaml @@ -1,15 +1,41 @@ name: Pull Request Validation on: - push: - branches: - - renovate/** pull_request: branches: - main - develop + types: + - opened + - edited + - synchronize jobs: + check-pr-title: + name: Check PR Title + runs-on: ubuntu-latest + permissions: + pull-requests: read + steps: + - uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + types: | + feat + fix + docs + style + refactor + perf + test + build + ci + chore + revert + requireScope: false + validateSingleCommit: true # also check lone commit if PR has only one + validate: name: Validate runs-on: ubuntu-latest @@ -28,20 +54,18 @@ jobs: dependency-groups: all - name: Install lefthook - shell: bash run: | source .venv/bin/activate lefthook install - name: Lint - shell: bash run: | source .venv/bin/activate lefthook run pre-commit --all-files - name: Tests with coverage run: | - uv run pytest --cov=hother.cancelable --cov-report=term-missing --cov-report=xml + uv run pytest --cov=hother.cancelable --cov-report=term-missing --cov-report=xml --junitxml=pytest.xml - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 @@ -52,6 +76,12 @@ jobs: name: pr-python-${{ matrix.python-version }} fail_ci_if_error: false + - name: Upload test results to Codecov + if: ${{ !cancelled() }} + uses: codecov/test-results-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + validate-docs: name: Validate Docs runs-on: ubuntu-24.04 @@ -65,7 +95,6 @@ jobs: dependency-groups: doc - name: Build docs - shell: bash run: | source .venv/bin/activate mkdocs build diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e99bfe5..cca4422 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -25,7 +25,7 @@ jobs: - name: Run tests with coverage run: | - uv run pytest --cov=hother.cancelable --cov-report=term-missing --cov-report=html --cov-report=xml --cov-report=json + uv run pytest --cov=hother.cancelable --cov-report=term-missing --cov-report=html --cov-report=xml --cov-report=json --junitxml=pytest.xml - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v5 @@ -36,6 +36,12 @@ jobs: name: python-${{ matrix.python-version }} fail_ci_if_error: false + - name: Upload test results to Codecov + if: ${{ !cancelled() }} + uses: codecov/test-results-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + - name: Upload coverage artifacts uses: actions/upload-artifact@v4 if: always()