diff --git a/.github/workflows/pydoc_preview.yml b/.github/workflows/pydoc_preview.yml index cb757a31..7fac9a63 100644 --- a/.github/workflows/pydoc_preview.yml +++ b/.github/workflows/pydoc_preview.yml @@ -1,4 +1,4 @@ -name: Test Docs Generation +name: Generate Docs on: push: diff --git a/.github/workflows/pydoc_publish.yml b/.github/workflows/pydoc_publish.yml index 9ca256e4..bbe9aeaa 100644 --- a/.github/workflows/pydoc_publish.yml +++ b/.github/workflows/pydoc_publish.yml @@ -1,4 +1,4 @@ -name: Publish Documentation Site +name: Publish Docs on: push: diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml index a7734361..efe374a6 100644 --- a/.github/workflows/pypi_publish.yml +++ b/.github/workflows/pypi_publish.yml @@ -1,4 +1,4 @@ -name: Publish to PyPi +name: Build and/or Publish on: push: diff --git a/.github/workflows/python_format_checks.yml b/.github/workflows/python_format_checks.yml deleted file mode 100644 index 834f2fa1..00000000 --- a/.github/workflows/python_format_checks.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Python Format Check - -on: - push: - branches: - - main - pull_request: {} - -jobs: - python-format-check: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Set up Poetry - uses: Gr1N/setup-poetry@v8 - with: - poetry-version: "1.7.1" - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.10' - cache: 'poetry' - - - name: Install dependencies - run: poetry install - - - name: Check code format - run: poetry run ruff format --check . diff --git a/.github/workflows/python_lint.yml b/.github/workflows/python_lint.yml index bcc8d337..30e08d3f 100644 --- a/.github/workflows/python_lint.yml +++ b/.github/workflows/python_lint.yml @@ -1,4 +1,4 @@ -name: Python Lint Check +name: Run Linters on: push: @@ -7,9 +7,11 @@ on: pull_request: {} jobs: - python-lint: + ruff-lint-check: + name: Ruff Lint Check runs-on: ubuntu-latest steps: + # Common steps: - name: Checkout code uses: actions/checkout@v4 - name: Set up Poetry @@ -22,8 +24,48 @@ jobs: python-version: '3.10' cache: 'poetry' - - name: Install dependencies - run: poetry install - + # Job-specifc step(s): - name: Format code run: poetry run ruff check . + + ruff-format-check: + name: Ruff Format Check + runs-on: ubuntu-latest + steps: + # Common steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Poetry + uses: Gr1N/setup-poetry@v8 + with: + poetry-version: "1.7.1" + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + cache: 'poetry' + + # Job-specifc step(s): + - name: Check code format + run: poetry run ruff format --check . + + mypy-check: + name: MyPy Check + runs-on: ubuntu-latest + steps: + # Common steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Poetry + uses: Gr1N/setup-poetry@v8 + with: + poetry-version: "1.7.1" + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + cache: 'poetry' + + # Job-specifc step(s): + - name: Check code format + run: poetry run ruff format --check . diff --git a/.github/workflows/python_pytest.yml b/.github/workflows/python_pytest.yml index 99af6997..e09099bd 100644 --- a/.github/workflows/python_pytest.yml +++ b/.github/workflows/python_pytest.yml @@ -1,6 +1,11 @@ -# This workflow will run pytest, prioritizing rebustness over speed. -# This is in contrast to the 'failfast' workflow, which prioritizes speed over robustness. -name: Pytest (All) +# This workflow will run pytest. +# +# There are two jobs which run in parallel: +# 1. pytest-fast: Run fast tests only, and fail fast so the dev knows asap if they broke something. +# 2. pytest: Run all tests, across multiple python versions. +# +# Note that pytest-fast also skips tests that require credentials, allowing it to run on forks. +name: Run Tests on: push: @@ -9,6 +14,31 @@ on: pull_request: {} jobs: + pytest-fast: + name: Pytest (Fast) + runs-on: ubuntu-latest + steps: + # Common steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Poetry + uses: Gr1N/setup-poetry@v8 + with: + poetry-version: "1.7.1" + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + cache: 'poetry' + - name: Install dependencies + run: poetry install + + # Job-specific step(s): + - name: Run Pytest (Fast Tests Only) + env: + GCP_GSM_CREDENTIALS: ${{ secrets.GCP_GSM_CREDENTIALS }} + run: poetry run pytest -m "not slow and not requires_creds" --durations=5 --exitfirst + pytest: name: Pytest (All, Python ${{ matrix.python-version }}) # Don't run on forks @@ -26,6 +56,7 @@ jobs: fail-fast: false steps: + # Common steps: - name: Checkout code uses: actions/checkout@v4 - name: Set up Poetry @@ -37,10 +68,10 @@ jobs: with: python-version: ${{ matrix.python-version }} cache: 'poetry' - - name: Install dependencies run: poetry install + # Job-specific step(s): - name: Run Pytest env: GCP_GSM_CREDENTIALS: ${{ secrets.GCP_GSM_CREDENTIALS }} diff --git a/.github/workflows/python_pytest_fast.yml b/.github/workflows/python_pytest_fast.yml deleted file mode 100644 index 1a829f59..00000000 --- a/.github/workflows/python_pytest_fast.yml +++ /dev/null @@ -1,33 +0,0 @@ -# This workflow will run pytest, prioritizing speed over robustness. -# This is in contrast to the 'all' workflow, which prioritizes robustness over speed. -name: Pytest (Fast Tests Only) - -on: - push: - branches: - - main - pull_request: {} - -jobs: - pytest-fast: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Set up Poetry - uses: Gr1N/setup-poetry@v8 - with: - poetry-version: "1.7.1" - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.10' - cache: 'poetry' - - - name: Install dependencies - run: poetry install - - - name: Run Pytest (Fast Tests Only) - env: - GCP_GSM_CREDENTIALS: ${{ secrets.GCP_GSM_CREDENTIALS }} - run: poetry run pytest -m "not slow and not requires_creds" --exitfirst