Skip to content

Unit tests

Unit tests #1344

Workflow file for this run

name: Unit tests
on:
# Check for updates every day
schedule:
- cron: "0 0 * * *"
# Check on any PR
pull_request:
branches: "*"
push:
branches: [master]
paths:
- "nuxeo/**/*.py"
- "setup.*"
- "tests/unit/*.py"
jobs:
unit-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
nuxeo:
- "2021"
- "2023.0.159"
python:
# Maximum supported version
# Note: 3.10 is still in alpha, so we stick with 3.9 until there is an official 3.10
- "3.9"
services:
nuxeo:
image: docker-private.packages.nuxeo.com/nuxeo/nuxeo:${{ matrix.nuxeo }}
credentials:
username: ${{ secrets.NUXEO_DOCKER_USER }}
password: ${{ secrets.NUXEO_DOCKER_PWD }}
env:
NUXEO_CLID: ${{ secrets.NUXEO_CLID }}
ports:
- 8080:8080
# Set health checks to wait for hotfixes installation
options: >-
--health-cmd "curl -f -s http://localhost:8080/nuxeo/runningstatus"
--health-interval 10s
--health-timeout 5s
--health-retries 60
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: python -m pip install -U pip tox
- name: Unit tests
env:
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
# Run tox using the version of Python in `PATH`
run: python -m tox -e unit
- name: Upload coverage to Codecov
if: ${{ success() }} || ${{ failure() }}
uses: codecov/codecov-action@v3.1.2
with:
files: ./coverage.xml
flags: unit
env_vars: PYTHON