mirror of
https://github.com/wger-project/wger.git
synced 2026-02-18 00:17:51 +01:00
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.9 to 3.0.10. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3.0.9...v3.0.10) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
89 lines
2.5 KiB
YAML
89 lines
2.5 KiB
YAML
name: Continous Integration
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- '**.py'
|
|
- 'requirements.txt'
|
|
pull_request:
|
|
paths:
|
|
- '**.py'
|
|
- 'requirements.txt'
|
|
|
|
jobs:
|
|
ci-job:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
max-parallel: 3
|
|
matrix:
|
|
#TODO: pypy3 has problems compiling lxml
|
|
python-version: [ '3.9', '3.10']
|
|
name: CI job (python ${{ matrix.python-version }})
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:12-alpine
|
|
env:
|
|
POSTGRES_USER: wger
|
|
POSTGRES_PASSWORD: wger
|
|
POSTGRES_DB: wger
|
|
ports:
|
|
- 5432:5432
|
|
# needed because the postgres container does not provide a health check
|
|
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
|
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Cache dependencies
|
|
uses: actions/cache@v3.0.10
|
|
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:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Display Python version
|
|
run: python -c "import sys; print(sys.version)"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install wheel coverage
|
|
pip install -r requirements_prod.txt
|
|
pip3 install -e .
|
|
|
|
# Only run the tests with coverage for one version of python
|
|
- name: Test the application with coverage (Postgres)
|
|
run: |
|
|
wger create-settings --database-type postgresql
|
|
coverage run --source='.' ./manage.py test
|
|
coverage lcov
|
|
if: matrix.python-version == 3.10
|
|
|
|
- name: Test the application (Postgres)
|
|
run: |
|
|
wger create-settings --database-type postgresql
|
|
python manage.py test
|
|
if: matrix.python-version != 3.10
|
|
|
|
# - name: Test the application (Sqlite)
|
|
# run: |
|
|
# wger create-settings
|
|
# coverage run --source='.' ./manage.py test
|
|
# coverage html --directory coverage-sqlite
|
|
# coverage report
|
|
|
|
- name: Coveralls
|
|
uses: coverallsapp/github-action@master
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
path-to-lcov: coverage.lcov
|
|
if: matrix.python-version == 3.10
|