Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve workflow with a collecting status check. #548

Merged
merged 2 commits into from Jul 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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

check:
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) }}
61 changes: 60 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,18 @@ jobs:
TOXPYTHON: '{{ '${{ matrix.toxpython }}' }}'
run: >
tox -e {{ '${{ matrix.tox_env }}' }} -v
{% raw %}
successful:
# this provides a single status check for branch merge rules
# (use this in `Require status checks to pass before merging` in branch settings)
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) }}
{% endraw %}
2 changes: 2 additions & 0 deletions setup.py
Expand Up @@ -11,11 +11,13 @@
from setuptools import Command
from setuptools import find_packages
from setuptools import setup

try:
# https://setuptools.pypa.io/en/latest/deprecated/distutils-legacy.html
from setuptools.command.build import build
except ImportError:
from distutils.command.build import build

from setuptools.command.develop import develop
from setuptools.command.easy_install import easy_install
from setuptools.command.install_lib import install_lib
Expand Down