|
| 1 | +name: Tox tests |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + test: |
| 7 | + if: "!contains(github.event.head_commit.message, '[skip ci]')" |
| 8 | + runs-on: ubuntu-latest |
| 9 | + strategy: |
| 10 | + matrix: |
| 11 | + python-version: [3.8, 3.7, 3.6] |
| 12 | + django: [31, 30, 22] |
| 13 | + cms: [38, 37] |
| 14 | + exclude: |
| 15 | + - django: 31 |
| 16 | + cms: 37 |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v2 |
| 19 | + - name: Set up Python ${{ matrix.python-version }} |
| 20 | + uses: actions/setup-python@v2 |
| 21 | + with: |
| 22 | + python-version: ${{ matrix.python-version }} |
| 23 | + - name: Cache pip |
| 24 | + uses: actions/cache@v1 |
| 25 | + with: |
| 26 | + path: ~/.cache/pip |
| 27 | + key: ${{ runner.os }}-pip-${{ matrix.toxenv }} |
| 28 | + restore-keys: | |
| 29 | + ${{ runner.os }}-pip-${{ matrix.toxenv }} |
| 30 | + - name: Cache tox |
| 31 | + uses: actions/cache@v1 |
| 32 | + with: |
| 33 | + path: .tox |
| 34 | + key: ${{ runner.os }}-tox-${{ format('{{py{0}-django{1}-cms{2}}}', matrix.python-version, matrix.django, matrix.cms) }}-${{ hashFiles('setup.cfg') }} |
| 35 | + restore-keys: | |
| 36 | + ${{ runner.os }}-tox-${{ format('{{py{0}-django{1}-cms{2}}}', matrix.python-version, matrix.django, matrix.cms) }}- |
| 37 | + - name: Install dependencies |
| 38 | + run: | |
| 39 | + sudo apt-get install gettext |
| 40 | + python -m pip install --upgrade pip tox>=3.5 |
| 41 | + - name: Test with tox |
| 42 | + env: |
| 43 | + TOX_ENV: ${{ format('py-django{1}-cms{2}', matrix.python-version, matrix.django, matrix.cms) }} |
| 44 | + COMMAND: coverage run |
| 45 | + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 46 | + COVERALLS_SERVICE_NAME: github |
| 47 | + run: | |
| 48 | + tox -e$TOX_ENV |
| 49 | + .tox/$TOX_ENV/bin/coverage xml |
| 50 | + .tox/$TOX_ENV/bin/coveralls |
| 51 | + - uses: codecov/codecov-action@v1 |
| 52 | + with: |
| 53 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 54 | + flags: unittests |
| 55 | + file: ./coverage.xml |
| 56 | + fail_ci_if_error: false |
| 57 | + services: |
| 58 | + redis: |
| 59 | + image: redis |
| 60 | + ports: |
| 61 | + - 6379:6379 |
0 commit comments