|
| 1 | +# copied from django-cte |
| 2 | +name: entity_emailer tests |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [master] |
| 6 | + pull_request: |
| 7 | + branches: [master,develop] |
| 8 | + |
| 9 | +jobs: |
| 10 | + tests: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + strategy: |
| 13 | + fail-fast: false |
| 14 | + matrix: |
| 15 | + python: ['3.7', '3.8', '3.9'] |
| 16 | + # Time to switch to pytest or nose2?? |
| 17 | + # nosetests is broken on 3.10 |
| 18 | + # AttributeError: module 'collections' has no attribute 'Callable' |
| 19 | + # https://github.com/nose-devs/nose/issues/1099 |
| 20 | + django: |
| 21 | + - 'Django~=3.2.0' |
| 22 | + - 'Django~=4.0.0' |
| 23 | + - 'Django~=4.1.0' |
| 24 | + - 'Django~=4.2.0' |
| 25 | + experimental: [false] |
| 26 | +# include: |
| 27 | +# - python: '3.9' |
| 28 | +# django: 'https://github.com/django/django/archive/refs/heads/main.zip#egg=Django' |
| 29 | +# experimental: true |
| 30 | +# # NOTE this job will appear to pass even when it fails because of |
| 31 | +# # `continue-on-error: true`. Github Actions apparently does not |
| 32 | +# # have this feature, similar to Travis' allow-failure, yet. |
| 33 | +# # https://github.com/actions/toolkit/issues/399 |
| 34 | + exclude: |
| 35 | + - python: '3.7' |
| 36 | + django: 'Django~=4.0.0' |
| 37 | + - python: '3.7' |
| 38 | + django: 'Django~=4.1.0' |
| 39 | + - python: '3.7' |
| 40 | + django: 'Django~=4.2.0' |
| 41 | + services: |
| 42 | + postgres: |
| 43 | + image: postgres:latest |
| 44 | + env: |
| 45 | + POSTGRES_DB: postgres |
| 46 | + POSTGRES_PASSWORD: postgres |
| 47 | + POSTGRES_USER: postgres |
| 48 | + ports: |
| 49 | + - 5432:5432 |
| 50 | + options: >- |
| 51 | + --health-cmd pg_isready |
| 52 | + --health-interval 10s |
| 53 | + --health-timeout 5s |
| 54 | + --health-retries 5 |
| 55 | + steps: |
| 56 | + - uses: actions/checkout@v3 |
| 57 | + - uses: actions/setup-python@v3 |
| 58 | + with: |
| 59 | + python-version: ${{ matrix.python }} |
| 60 | + - name: Setup |
| 61 | + run: | |
| 62 | + python --version |
| 63 | + pip install --upgrade pip wheel |
| 64 | + pip install -r requirements/requirements.txt |
| 65 | + pip install -r requirements/requirements-testing.txt |
| 66 | + pip install "${{ matrix.django }}" |
| 67 | + pip freeze |
| 68 | + - name: Run tests |
| 69 | + env: |
| 70 | + DB_SETTINGS: >- |
| 71 | + { |
| 72 | + "ENGINE":"django.db.backends.postgresql_psycopg2", |
| 73 | + "NAME":"entity_emailer", |
| 74 | + "USER":"postgres", |
| 75 | + "PASSWORD":"postgres", |
| 76 | + "HOST":"localhost", |
| 77 | + "PORT":"5432" |
| 78 | + } |
| 79 | + run: | |
| 80 | + coverage run manage.py test entity_emailer |
| 81 | + coverage report --fail-under=99 |
| 82 | + continue-on-error: ${{ matrix.experimental }} |
| 83 | + - name: Check style |
| 84 | + run: flake8 entity_emailer |
0 commit comments