build: run tests on python 3.11 #15349
Workflow file for this run
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: CI | |
on: | |
pull_request: | |
jobs: | |
pytest: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ['py38', 'py311', 'py312'] | |
django-version: ['django42'] | |
db-version: ['mysql80'] | |
pytest-split-group: [1, 2, 3, 4, 5, 6] | |
status: [''] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Format Python Version | |
id: format_python_version | |
shell: bash | |
run: | | |
# Remove 'py' and insert a dot to format the version | |
FORMATTED_VERSION=${{ matrix.python-version }} # e.g., py38 | |
FORMATTED_VERSION=${FORMATTED_VERSION/py3/3.} # becomes 3.8 | |
# Set environment variables | |
echo "PYTHON_VERSION=$FORMATTED_VERSION" >> $GITHUB_ENV | |
# Output formatted version for use in subsequent steps | |
echo "Using Python Version: $FORMATTED_VERSION" | |
- run: make ci_up | |
- name: run tests | |
env: | |
DB_HOST: ${{ matrix.db-version }} | |
PYTEST_SPLIT_GROUP: ${{ matrix.pytest-split-group }} | |
run: make ci_test TOXENV=${{ matrix.python-version }}-${{ matrix.django-version }} | |
# Unfortunately, continue-on-error marks the job as successful. We really want something like "allow failure" | |
# that would note the failure, but not fail the entire workflow and not email the author about it. | |
# See https://github.com/actions/toolkit/issues/399 | |
continue-on-error: ${{ matrix.status == 'ignored' }} | |
- name: Upload coverage | |
if: matrix.db-version == 'mysql80' | |
uses: actions/upload-artifact@v2 | |
with: | |
name: coverage${{ matrix.pytest-split-group }} | |
path: .coverage | |
# Combine and upload coverage reports. | |
coverage: | |
needs: pytest | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: make ci_up | |
env: | |
PYTHON_VERSION: 3.8 | |
- name: Download all artifacts | |
# Downloads coverage1, coverage2, etc. | |
uses: actions/download-artifact@v2 | |
- name: Run coverage | |
run: make ci_coverage | |
- uses: codecov/codecov-action@v1 | |
quality: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: make ci_up | |
env: | |
PYTHON_VERSION: 3.8 | |
- run: make ci_quality | |
semgrep: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.8', '3.11', '3.12'] | |
steps: | |
- uses: actions/checkout@v3 | |
- run: make ci_up | |
env: | |
PYTHON_VERSION: ${{ matrix.python-version }} | |
- name: Run semgrep Django rules | |
run: make ci_semgrep |