Skip to content

Change naming of form questions #7

Change naming of form questions

Change naming of form questions #7

Workflow file for this run

name: Tests
on:
push:
branches: [ main ]
paths-ignore:
- 'doc/**'
- 'src/pretalx/locale/**'
pull_request:
branches: [ main ]
paths-ignore:
- 'doc/**'
- 'src/pretalx/locale/**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
FORCE_COLOR: 1
jobs:
test:
runs-on: ubuntu-latest
name: Tests
strategy:
fail-fast: false
matrix:
python-version: [3.9, '3.10', 3.11]
database: [sqlite, postgres, mysql]
exclude:
- database: mysql
python-version: 3.9
- database: mysql
python-version: 3.11
- database: sqlite
python-version: 3.9
- database: sqlite
python-version: 3.11
steps:
- uses: actions/checkout@v4
- uses: getong/[email protected]
with:
mariadb version: '10.7'
mysql database: 'pretalx'
mysql root password: ''
if: matrix.database == 'mysql'
- uses: harmon758/postgresql-action@v1
with:
postgresql version: '14'
postgresql db: 'pretalx'
postgresql user: 'postgres'
postgresql password: 'postgres'
if: matrix.database == 'postgres'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Set up node
uses: actions/setup-node@v4
with:
node-version: 'latest'
- name: Install system dependencies
run: |
sudo apt update
sudo apt install gettext
- name: Install system dependencies for mysql
run: sudo apt update && sudo apt install mariadb-client-10.6
if: matrix.database == 'mysql'
- name: Install Python dependencies
run: python -m pip install -Ue ".[dev]"
- name: Install MySQL dependencies
run: python -m pip install -Ue ".[mysql]"
if: matrix.database == 'mysql'
- name: Install Postgres dependencies
run: python -m pip install -Ue ".[postgres]"
if: matrix.database == 'postgres'
- name: Install frontend dependencies
run: npm ci
working-directory: ./src/pretalx/frontend/schedule-editor
- name: Run checks
run: python manage.py check --deploy
working-directory: ./src
- name: Run checks
run: python manage.py compilemessages
working-directory: ./src
- name: Run tests
working-directory: ./src
run: python -m pytest -nauto -p no:sugar --reruns 3 --cov-report=term-missing:skip-covered tests
env:
PRETALX_CONFIG_FILE: 'tests/ci_${{ matrix.database }}.cfg'
- name: Show coverage as build info
working-directory: ./src
run: |
python -m coverage json
export TOTAL_COV=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
echo "TOTAL_COV=$TOTAL_COV" >> $GITHUB_ENV
echo "## Test coverage: $TOTAL_COV%" >> $GITHUB_STEP_SUMMARY
python -m coverage report --skip-covered --skip-empty --show-missing --format=markdown >> $GITHUB_STEP_SUMMARY
python -m coverage report
if: matrix.database == 'postgres' && matrix.python-version == '3.10'
- name: "Make badge"
uses: schneegans/[email protected]
with:
# GIST_TOKEN is a GitHub personal access token with scope "gist".
auth: ${{ secrets.GIST_TOKEN }}
gistID: 0ac3e4314d780e809c0164c8c329f36f
filename: covbadge.json
label: coverage
message: ${{ env.TOTAL_COV }}%
color: "#3aa57c"
if: env.TOTAL_COV && github.ref == 'refs/heads/main'