mirror of
https://github.com/wger-project/wger.git
synced 2026-02-18 23:42:04 +01:00
73 lines
1.9 KiB
YAML
73 lines
1.9 KiB
YAML
name: Continous Integration
|
|
|
|
on:
|
|
push:
|
|
branches: [ master, ]
|
|
paths:
|
|
- '**.py'
|
|
- 'requirements.txt'
|
|
pull_request:
|
|
# The branches below must be a subset of the branches above
|
|
branches: [ master, ]
|
|
paths:
|
|
- '**.py'
|
|
- 'requirements.txt'
|
|
|
|
jobs:
|
|
ci-job:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
#TODO: pypy3 has problems compiling lxml
|
|
python-version: [ '3.9', '3.10', '3.11' ]
|
|
name: CI job (python ${{ matrix.python-version }})
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Cache dependencies
|
|
uses: actions/cache@v3.3.1
|
|
with:
|
|
path: ~/.cache/pip
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pip-
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
cache: 'pip'
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Display Python version
|
|
run: python -c "import sys; print(sys.version)"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install --upgrade pip
|
|
pip install wheel coverage
|
|
pip install -r requirements_prod.txt
|
|
pip install -e .
|
|
|
|
# Only run the tests with coverage for one version of python
|
|
- name: Test the application with coverage
|
|
run: |
|
|
wger create-settings
|
|
coverage run --source='.' ./manage.py test
|
|
coverage lcov
|
|
if: matrix.python-version == 3.11
|
|
|
|
- name: Test the application
|
|
run: |
|
|
wger create-settings
|
|
python manage.py test
|
|
if: matrix.python-version != 3.11
|
|
|
|
- name: Coveralls
|
|
uses: coverallsapp/github-action@master
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
path-to-lcov: coverage.lcov
|
|
if: matrix.python-version == 3.11
|
|
|