ci: add changes to limit CI runs on draft PRs #76
Workflow file for this run
This file contains 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: | |
paths-ignore: | |
- "docs/**" | |
- "README.md" | |
branches: | |
- "main" | |
pull_request: | |
paths-ignore: | |
- "docs/**" | |
- "README.md" | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- ready_for_review | |
workflow_dispatch: | |
jobs: | |
test: | |
name: Test on ubuntu-latest, Python ${{ matrix.python-version }} | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Additional info about the build | |
shell: bash | |
run: | | |
uname -a | |
df -h | |
ulimit -a | |
- name: Setup Python ${{matrix.python-version}} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
python -m pip install '.[test]' | |
- name: List versions | |
run: | | |
python -m pip list | |
- name: Run short tests | |
if: "github.event.pull_request.draft" | |
run: | | |
cd tests/ | |
pytest -v -m "not slow" --cov=gha_runner --cov-report=xml --color=yes . | |
- name: Upload coverage | |
if: "github.event.pull_request.draft" | |
uses: codecov/codecov-action@v4 | |
with: | |
file: ./coverage.xml | |
flags: unittests-fast | |
name: codecov-py${{ matrix.python-version }} | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Run all tests | |
if: "!github.event.pull_request.draft" | |
run: | | |
cd tests/ | |
pytest -v --cov=gha_runner --cov-report=xml --color=yes . | |
- name: CodeCov | |
if: "!github.event.pull_request.draft" | |
uses: codecov/codecov-action@v4 | |
with: | |
file: ./coverage.xml | |
flags: unittests | |
name: codecov-py${{ matrix.python-version }} | |
token: ${{ secrets.CODECOV_TOKEN }} |