Skip to content

Commit

Permalink
Improve workflow with a collecting status check.
Browse files Browse the repository at this point in the history
  • Loading branch information
ionelmc committed Jul 22, 2022
1 parent 218419f commit 5bf78cd
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 51 deletions.
49 changes: 0 additions & 49 deletions .github/workflows/examples.yml

This file was deleted.

55 changes: 54 additions & 1 deletion .github/workflows/test.yml
@@ -1,6 +1,47 @@
name: Tests
on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]
jobs:
examples:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["pypy-3.7", "3.9"]
target: [
"src-layout",
"adhoc-layout",
]
include:
# Add new helper variables to existing jobs
- {python-version: "pypy-3.7", tox-python-version: "pypy3"}
- {python-version: "3.9", tox-python-version: "py39"}
steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key:
examples-v1-${{ hashFiles('**/tox.ini') }}
restore-keys: |
examples-v1-
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U wheel
python -m pip install --progress-bar=off tox -rci/requirements.txt
- name: Examples
run: |
cd examples/${{ matrix.target }}
tox -v -e ${{ matrix.tox-python-version }}
test:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -165,3 +206,15 @@ jobs:
TOXPYTHON: '${{ matrix.toxpython }}'
run: >
tox -e ${{ matrix.tox_env }} -v
- name: all checks pass
if: always()
needs:
- test
- examples
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
58 changes: 57 additions & 1 deletion ci/templates/.github/workflows/test.yml
@@ -1,6 +1,50 @@
name: Tests
on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]
jobs:
{%- raw %}
examples:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["pypy-3.7", "3.9"]
target: [
"src-layout",
"adhoc-layout",
]
include:
# Add new helper variables to existing jobs
- {python-version: "pypy-3.7", tox-python-version: "pypy3"}
- {python-version: "3.9", tox-python-version: "py39"}
steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key:
examples-v1-${{ hashFiles('**/tox.ini') }}
restore-keys: |
examples-v1-
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U wheel
python -m pip install --progress-bar=off tox -rci/requirements.txt
- name: Examples
run: |
cd examples/${{ matrix.target }}
tox -v -e ${{ matrix.tox-python-version }}
{%- endraw %}

test:
name: {{ '${{ matrix.name }}' }}
runs-on: {{ '${{ matrix.os }}' }}
Expand Down Expand Up @@ -63,3 +107,15 @@ jobs:
TOXPYTHON: '{{ '${{ matrix.toxpython }}' }}'
run: >
tox -e {{ '${{ matrix.tox_env }}' }} -v
- name: all checks pass
if: always()
needs:
- test
- examples
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: {{ '${{ toJSON(needs) }}' }}

0 comments on commit 5bf78cd

Please sign in to comment.