Unit tests #1829
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: 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@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
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/[email protected] | |
with: | |
files: ./coverage.xml | |
flags: unit | |
env_vars: PYTHON |