|
| 1 | +# Generated from: |
| 2 | +# https://github.com/plone/meta/tree/main/src/plone/meta/default |
| 3 | +# See the inline comments on how to expand/tweak this configuration file |
| 4 | +name: Tests |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + permissions: |
| 12 | + contents: read |
| 13 | + pull-requests: write |
| 14 | + strategy: |
| 15 | + # We want to see all failures: |
| 16 | + fail-fast: false |
| 17 | + matrix: |
| 18 | + os: |
| 19 | + - ["ubuntu", "ubuntu-latest"] |
| 20 | + config: |
| 21 | + # [Python version, visual name, tox env] |
| 22 | + - ["3.13", "6.2 on py3.13", "py313-plone62"] |
| 23 | + - ["3.10", "6.2 on py3.10", "py310-plone62"] |
| 24 | + |
| 25 | + runs-on: ${{ matrix.os[1] }} |
| 26 | + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name |
| 27 | + name: ${{ matrix.config[1] }} |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@v5 |
| 30 | + with: |
| 31 | + persist-credentials: false |
| 32 | + - name: Set up Python |
| 33 | + uses: actions/setup-python@v6 |
| 34 | + with: |
| 35 | + python-version: ${{ matrix.config[0] }} |
| 36 | + allow-prereleases: true |
| 37 | + |
| 38 | +## |
| 39 | +# Add extra configuration options in .meta.toml: |
| 40 | +# [github] |
| 41 | +# extra_lines_after_os_dependencies = """ |
| 42 | +# _your own configuration lines_ |
| 43 | +# """ |
| 44 | +## |
| 45 | + - name: Pip cache |
| 46 | + uses: actions/cache@v4 |
| 47 | + with: |
| 48 | + path: ~/.cache/pip |
| 49 | + key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }} |
| 50 | + restore-keys: | |
| 51 | + ${{ runner.os }}-pip-${{ matrix.config[0] }}- |
| 52 | + ${{ runner.os }}-pip- |
| 53 | + - name: Install dependencies |
| 54 | + run: | |
| 55 | + python -m pip install --upgrade pip |
| 56 | + pip install tox |
| 57 | + - name: Initialize tox |
| 58 | + # the bash one-liner below does not work on Windows |
| 59 | + if: contains(matrix.os, 'ubuntu') |
| 60 | + run: | |
| 61 | + if [ `tox list --no-desc -f init|wc -l` = 1 ]; then tox -e init;else true; fi |
| 62 | + - name: Test |
| 63 | + run: tox -e ${{ matrix.config[2] }} |
| 64 | + |
| 65 | + |
| 66 | +## |
| 67 | +# Add extra configuration options in .meta.toml: |
| 68 | +# [github] |
| 69 | +# extra_lines = """ |
| 70 | +# _your own configuration lines_ |
| 71 | +# """ |
| 72 | +## |
0 commit comments