Skip to content

Bump github/codeql-action from 2 to 3 #1690

Bump github/codeql-action from 2 to 3

Bump github/codeql-action from 2 to 3 #1690

Workflow file for this run

name: "coverage"
on:
- pull_request
# Explicitely set permissions to allow Dependabot workflow runs to write in the PR
# for coverage's reporting.
# By default, these are read-only when the actions are ran by Dependabot
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#changing-github_token-permissions
permissions:
pull-requests: write
jobs:
coverage:
name: Test & Coverage
# Service containers to run with `container-job`
services:
# Label used to access the service container
postgres:
image: postgres
ports:
- 5432:5432
env:
POSTGRES_USER: apilos
POSTGRES_NAME: apilos
POSTGRES_HOST: postgres
POSTGRES_PASSWORD: apilos
POSTGRES_PORT: 5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: pip install -r requirements.txt -r dev-requirements.txt
- name: Execute test with coverage
run: |
coverage run --source='.' manage.py test
env:
DATABASE_URL: postgres://apilos:apilos@localhost:5432/apilos
DB_READONLY: postgres://apilos:apilos@localhost:5432/apilos
- name: Create coverage report
run: coverage xml -o coverage.xml
- name: Post coverage to PR
uses: orgoro/coverage@v3
with:
coverageFile: coverage.xml
token: ${{ secrets.GITHUB_TOKEN }}
thresholdAll: 0.6
thresholdNew: 0.5
thresholdModified: 0.4