Bump coverage from 7.6.8 to 7.6.9 (#600) #974
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: Continuous integration | |
on: [push] | |
jobs: | |
runner-job: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
django: ["django==4.2.17", "django==5.0.10", "django==5.1.4"] | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_PASSWORD: postgres | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
- name: Install pnpm | |
run: npm install -g pnpm | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v4 | |
name: Setup pnpm cache | |
with: | |
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install javascript packages | |
working-directory: ./frontend | |
run: pnpm install | |
- name: Cache python packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements**.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install python packages | |
run: | | |
pip install ${{ matrix.django }} && pip install -r example_project/requirements_test.txt && playwright install chromium && pip install -r example_project/requirements_ci.txt && pip install -e . | |
- name: Run tests | |
run: python -Wd example_project/manage.py test django_mptt_example | |
env: | |
POSTGRES_HOST: localhost | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_PORT: 5432 | |
- name: Build javascript | |
working-directory: ./frontend | |
run: pnpm run build | |
- name: Create javascript coverage directory | |
run: mkdir js_coverage | |
- name: Test with coverage | |
run: | | |
COVERAGE=true coverage run --source=django_mptt_admin,example_project/django_mptt_example example_project/manage.py test django_mptt_example | |
env: | |
POSTGRES_HOST: localhost | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_PORT: 5432 | |
- name: Merge Python coverage | |
run: coverage report && coverage lcov | |
- name: Merge javascript coverage | |
working-directory: ./coverage | |
run: pnpm i && pnpm run merge_coverage | |
- name: Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
verbose: true |