SIANXKE-401: Updated Python support #24
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: Run linter and tests | |
on: [push, pull_request] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
- "3.12" | |
- "3.13" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install codecov black | |
- name: Lint with black | |
run: black ./content_disposition ./tests --check | |
- name: Python versions | |
run: | | |
echo "Python ${{ matrix.python-version }}" | |
python --version | |
- name: Setup environment | |
run: | | |
pip install -e . | |
pip install -r requirements.txt | |
- name: Run tests | |
run: | | |
# prepare Django project: link all necessary data from the test project into the root directory | |
# Hint: Simply changing the directory does not work (leads to missing files in coverage report) | |
ln -s ./tests/testapp testapp | |
ln -s ./tests/core core | |
ln -s ./tests/manage.py manage.py | |
# run tests with coverage | |
coverage run --source='./content_disposition' manage.py test | |
coverage report | |
coverage xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 |