|
| 1 | +name: Linting - Tests |
| 2 | + |
| 3 | +on: [push] |
| 4 | + |
| 5 | +jobs: |
| 6 | + lint: |
| 7 | + runs-on: ubuntu-latest |
| 8 | + if: "!contains(github.event.head_commit.message, '[skip ci]')" |
| 9 | + strategy: |
| 10 | + matrix: |
| 11 | + python-version: [3.8] |
| 12 | + toxenv: [pep8, isort, black, pypi-description, docs, towncrier] |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v2 |
| 15 | + - name: Set up Python ${{ matrix.python-version }} |
| 16 | + uses: actions/setup-python@v1 |
| 17 | + with: |
| 18 | + python-version: ${{ matrix.python-version }} |
| 19 | + - name: Cache pip |
| 20 | + uses: actions/cache@v1 |
| 21 | + with: |
| 22 | + path: ~/.cache/pip |
| 23 | + key: ${{ runner.os }}-pip-${{ matrix.toxenv }} |
| 24 | + restore-keys: | |
| 25 | + ${{ runner.os }}-pip-${{ matrix.toxenv }} |
| 26 | + - name: Cache tox |
| 27 | + uses: actions/cache@v1 |
| 28 | + with: |
| 29 | + path: .tox |
| 30 | + key: ${{ runner.os }}-lint-${{ matrix.toxenv }}-${{ hashFiles('setup.cfg') }} |
| 31 | + restore-keys: | |
| 32 | + ${{ runner.os }}-lint-${{ matrix.toxenv }}- |
| 33 | + - name: Install dependencies |
| 34 | + run: | |
| 35 | + python -m pip install --upgrade pip setuptools tox>=1.8 |
| 36 | + - name: Test with tox |
| 37 | + run: | |
| 38 | + tox -e${{ matrix.toxenv }} |
| 39 | +
|
| 40 | + test: |
| 41 | + if: "!contains(github.event.head_commit.message, '[skip ci]')" |
| 42 | + runs-on: ubuntu-latest |
| 43 | + strategy: |
| 44 | + matrix: |
| 45 | + python-version: [3.8, 3.7, 3.6, 3.5] |
| 46 | + django: [30, 22] |
| 47 | + cms: [37] |
| 48 | + exclude: |
| 49 | + - python-version: 3.5 |
| 50 | + django: 30 |
| 51 | + steps: |
| 52 | + - uses: actions/checkout@v2 |
| 53 | + - name: Set up Python ${{ matrix.python-version }} |
| 54 | + uses: actions/setup-python@v1 |
| 55 | + with: |
| 56 | + python-version: ${{ matrix.python-version }} |
| 57 | + - name: Cache pip |
| 58 | + uses: actions/cache@v1 |
| 59 | + with: |
| 60 | + path: ~/.cache/pip |
| 61 | + key: ${{ runner.os }}-pip-${{ matrix.toxenv }} |
| 62 | + restore-keys: | |
| 63 | + ${{ runner.os }}-pip-${{ matrix.toxenv }} |
| 64 | + - name: Cache tox |
| 65 | + uses: actions/cache@v1 |
| 66 | + with: |
| 67 | + path: .tox |
| 68 | + key: ${{ runner.os }}-tox-${{ format('{{py{0}-django{1}-cms{2}}}', matrix.python-version, matrix.django, matrix.cms) }}-${{ hashFiles('setup.cfg') }} |
| 69 | + restore-keys: | |
| 70 | + ${{ runner.os }}-tox-${{ format('{{py{0}-django{1}-cms{2}}}', matrix.python-version, matrix.django, matrix.cms) }}- |
| 71 | + - name: Install dependencies |
| 72 | + run: | |
| 73 | + sudo apt-get install gettext |
| 74 | + python -m pip install --upgrade pip tox>=3.5 |
| 75 | + - name: Test with tox |
| 76 | + env: |
| 77 | + TOX_ENV: ${{ format('py{0}-django{1}-cms{2}', matrix.python-version, matrix.django, matrix.cms) }} |
| 78 | + COMMAND: coverage run |
| 79 | + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} |
| 80 | + run: | |
| 81 | + tox -e$TOX_ENV |
| 82 | + .tox/$TOX_ENV/bin/coverage xml |
| 83 | + .tox/$TOX_ENV/bin/coveralls |
| 84 | + - uses: codecov/codecov-action@v1 |
| 85 | + with: |
| 86 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 87 | + flags: unittests |
| 88 | + file: ./coverage.xml |
| 89 | + fail_ci_if_error: false |
| 90 | + services: |
| 91 | + redis: |
| 92 | + image: redis |
| 93 | + ports: |
| 94 | + - 6379:6379 |
0 commit comments