|
| 1 | +name: Tests |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: ["main", "v5.x"] |
| 5 | + pull_request: |
| 6 | + # Allow to run this workflow manually from the Actions tab |
| 7 | + workflow_dispatch: |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + strategy: |
| 12 | + fail-fast: true |
| 13 | + matrix: |
| 14 | + config: |
| 15 | + # [Python version, tox env] |
| 16 | + # - ["2.7", "py27-plone52"] |
| 17 | + # - ["3.7", "py37-plone52"] |
| 18 | + - ["3.8", "py38-plone60"] |
| 19 | + - ["3.9", "py39-plone60"] |
| 20 | + - ["3.10", "py310-plone60"] |
| 21 | + - ["3.11", "py311-plone60"] |
| 22 | + name: ${{ matrix.config[1] }} |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v3 |
| 25 | + - name: Set up Python |
| 26 | + uses: actions/setup-python@v3 |
| 27 | + with: |
| 28 | + python-version: ${{ matrix.config[0] }} |
| 29 | + - name: Pip cache |
| 30 | + uses: actions/cache@v3 |
| 31 | + with: |
| 32 | + path: | |
| 33 | + ~/.cache/pip |
| 34 | + eggs |
| 35 | + key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }} |
| 36 | + restore-keys: | |
| 37 | + ${{ runner.os }}-pip-${{ matrix.config[0] }}- |
| 38 | + ${{ runner.os }}-pip- |
| 39 | + - name: Install dependencies |
| 40 | + run: | |
| 41 | + python -m pip install --upgrade pip |
| 42 | + pip install tox |
| 43 | + - name: Test |
| 44 | + run: tox -e ${{ matrix.config[1] }} |
| 45 | + - name: Upload coverage data to coveralls.io |
| 46 | + run: | |
| 47 | + pip install coveralls |
| 48 | + coveralls --service=github |
| 49 | + env: |
| 50 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 51 | + COVERALLS_FLAG_NAME: ${{ matrix.config[1] }} |
| 52 | + COVERALLS_PARALLEL: true |
| 53 | + |
| 54 | + coveralls_finish: |
| 55 | + needs: build |
| 56 | + runs-on: ubuntu-latest |
| 57 | + steps: |
| 58 | + - name: Finished |
| 59 | + run: | |
| 60 | + pip install --upgrade coveralls |
| 61 | + coveralls --service=github --finish |
| 62 | + env: |
| 63 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments