summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorJacob Walls <jacobtylerwalls@gmail.com>2026-02-04 11:41:11 -0500
committerJacob Walls <jacobtylerwalls@gmail.com>2026-02-11 13:35:08 -0500
commitc507aaf9abeff4b93b7f9bdbc55801f2ccfc2d01 (patch)
treed831d3d8e9b80c87c6524ef49fc658d54c9ab6d0 /.github
parentbb7f4f8a734f0f4dccd88e130b1c2ccd68b2d097 (diff)
Refs #36620 -- Guarded coverage tests workflow behind a label.
This also removes the skip on the primary tests workflow so that it runs more predictably.
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/coverage_tests.yml40
-rw-r--r--.github/workflows/tests.yml1
2 files changed, 31 insertions, 10 deletions
diff --git a/.github/workflows/coverage_tests.yml b/.github/workflows/coverage_tests.yml
index 07f461db69..fa43897a2b 100644
--- a/.github/workflows/coverage_tests.yml
+++ b/.github/workflows/coverage_tests.yml
@@ -2,9 +2,9 @@ name: Coverage Tests
on:
pull_request:
+ types: [labeled, synchronize, opened, reopened]
paths-ignore:
- 'docs/**'
- - '**/*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@@ -15,9 +15,24 @@ permissions:
jobs:
coverage:
- name: Coverage Tests (Windows)
- runs-on: windows-latest
+ if: contains(github.event.pull_request.labels.*.name, 'coverage')
+ runs-on: ubuntu-latest
+ name: Coverage Tests (PostgreSQL)
timeout-minutes: 60
+ services:
+ postgres:
+ image: postgres:18-alpine
+ env:
+ POSTGRES_DB: django
+ POSTGRES_USER: user
+ POSTGRES_PASSWORD: postgres
+ ports:
+ - 5432:5432
+ options: >-
+ --health-cmd pg_isready
+ --health-interval 10s
+ --health-timeout 5s
+ --health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v6
@@ -32,19 +47,26 @@ jobs:
cache: 'pip'
cache-dependency-path: 'tests/requirements/py3.txt'
+ - name: Update apt repo
+ run: sudo apt update
+ - name: Install libmemcached-dev for pylibmc
+ run: sudo apt install -y libmemcached-dev
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
- python -m pip install -r tests/requirements/py3.txt -e .
+ python -m pip install -r tests/requirements/py3.txt -r tests/requirements/postgres.txt -e .
python -m pip install 'coverage[toml]' diff-cover
+ - name: Create PostgreSQL settings file
+ run: mv ./.github/workflows/data/test_postgres.py.tpl ./tests/test_postgres.py
+
- name: Run tests with coverage
env:
PYTHONPATH: ${{ github.workspace }}/tests
COVERAGE_PROCESS_START: ${{ github.workspace }}/tests/.coveragerc
RUNTESTS_DIR: ${{ github.workspace }}/tests
run: |
- python -Wall tests/runtests.py -v2
+ python -Wall tests/runtests.py --settings=test_postgres -v2
- name: Generate coverage report
if: success()
@@ -59,11 +81,11 @@ jobs:
- name: Generate diff coverage report
if: success()
run: |
- if (Test-Path 'tests/coverage.xml') {
+ if [ -f tests/coverage.xml ]; then
diff-cover tests/coverage.xml --compare-branch=origin/main --fail-under=0 > diff-cover-report.md
- } else {
- Set-Content -Path diff-cover-report.md -Value 'No coverage data available.'
- }
+ else
+ echo "No coverage data available." > diff-cover-report.md
+ fi
- name: Save PR number
if: success()
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 3012ccb83e..411fc7736a 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -19,7 +19,6 @@ permissions:
jobs:
windows:
- if: github.event_name == 'push'
runs-on: windows-latest
strategy:
matrix: