|
1 | 1 | name: Tests |
2 | | -on: [push, pull_request] |
| 2 | +on: [push, pull_request, workflow_dispatch] |
3 | 3 | jobs: |
| 4 | +{%- raw %} |
| 5 | + examples: |
| 6 | + runs-on: ubuntu-latest |
| 7 | + strategy: |
| 8 | + fail-fast: false |
| 9 | + matrix: |
| 10 | + python-version: ["pypy-3.7", "3.9"] |
| 11 | + target: [ |
| 12 | + "src-layout", |
| 13 | + "adhoc-layout", |
| 14 | + ] |
| 15 | + include: |
| 16 | + # Add new helper variables to existing jobs |
| 17 | + - {python-version: "pypy-3.7", tox-python-version: "pypy3"} |
| 18 | + - {python-version: "3.9", tox-python-version: "py39"} |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v2 |
| 21 | + |
| 22 | + - name: Set up Python ${{ matrix.python-version }} |
| 23 | + uses: actions/setup-python@v2 |
| 24 | + with: |
| 25 | + python-version: ${{ matrix.python-version }} |
| 26 | + |
| 27 | + - name: Cache |
| 28 | + uses: actions/cache@v2 |
| 29 | + with: |
| 30 | + path: ~/.cache/pip |
| 31 | + key: |
| 32 | + examples-v1-${{ hashFiles('**/tox.ini') }} |
| 33 | + restore-keys: | |
| 34 | + examples-v1- |
| 35 | +
|
| 36 | + - name: Install dependencies |
| 37 | + run: | |
| 38 | + python -m pip install -U pip |
| 39 | + python -m pip install -U wheel |
| 40 | + python -m pip install --progress-bar=off tox -rci/requirements.txt |
| 41 | +
|
| 42 | + - name: Examples |
| 43 | + run: | |
| 44 | + cd examples/${{ matrix.target }} |
| 45 | + tox -v -e ${{ matrix.tox-python-version }} |
| 46 | +{%- endraw %} |
| 47 | + |
4 | 48 | test: |
5 | 49 | name: {{ '${{ matrix.name }}' }} |
6 | 50 | runs-on: {{ '${{ matrix.os }}' }} |
@@ -63,3 +107,18 @@ jobs: |
63 | 107 | TOXPYTHON: '{{ '${{ matrix.toxpython }}' }}' |
64 | 108 | run: > |
65 | 109 | tox -e {{ '${{ matrix.tox_env }}' }} -v |
| 110 | +{% raw %} |
| 111 | + successful: |
| 112 | + # this provides a single status check for branch merge rules |
| 113 | + # (use this in `Require status checks to pass before merging` in branch settings) |
| 114 | + if: always() |
| 115 | + needs: |
| 116 | + - test |
| 117 | + - examples |
| 118 | + runs-on: ubuntu-latest |
| 119 | + steps: |
| 120 | + - name: Decide whether the needed jobs succeeded or failed |
| 121 | + uses: re-actors/alls-green@release/v1 |
| 122 | + with: |
| 123 | + jobs: ${{ toJSON(needs) }} |
| 124 | +{% endraw %} |
0 commit comments