-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
175 additions
and
228 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
Windows: | ||
name: 'Windows (${{ matrix.python }})' | ||
runs-on: 'windows-latest' | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python: ['3.7', '3.8', '3.9', '3.10'] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
cache: pip | ||
cache-dependency-path: test-requirements.txt | ||
- name: Run tests | ||
run: ./ci.sh | ||
shell: bash | ||
env: | ||
# Should match 'name:' up above | ||
JOB_NAME: 'Windows (${{ matrix.python }})' | ||
|
||
Ubuntu: | ||
name: 'Ubuntu (${{ matrix.python }}${{ matrix.extra_name }})' | ||
timeout-minutes: 10 | ||
runs-on: 'ubuntu-latest' | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python: ['3.7', '3.8', '3.9', '3.10', '3.11-dev'] | ||
check_formatting: ['0'] | ||
extra_name: [''] | ||
include: | ||
- python: '3.10' | ||
check_formatting: '1' | ||
extra_name: ', check formatting' | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup python | ||
uses: actions/setup-python@v2 | ||
if: "!endsWith(matrix.python, '-dev')" | ||
with: | ||
python-version: ${{ matrix.python }} | ||
cache: pip | ||
cache-dependency-path: test-requirements.txt | ||
- name: Setup python (dev) | ||
uses: deadsnakes/action@v2.0.2 | ||
if: endsWith(matrix.python, '-dev') | ||
with: | ||
python-version: '${{ matrix.python }}' | ||
- name: Run tests | ||
run: ./ci.sh | ||
env: | ||
CHECK_FORMATTING: '${{ matrix.check_formatting }}' | ||
# Should match 'name:' up above | ||
JOB_NAME: 'Ubuntu (${{ matrix.python }}${{ matrix.extra_name }})' | ||
|
||
macOS: | ||
name: 'macOS (${{ matrix.python }})' | ||
timeout-minutes: 10 | ||
runs-on: 'macos-latest' | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python: ['3.7', '3.8', '3.9', '3.10'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
cache: pip | ||
cache-dependency-path: test-requirements.txt | ||
- name: Run tests | ||
run: ./ci.sh | ||
env: | ||
# Should match 'name:' up above | ||
JOB_NAME: 'macOS (${{ matrix.python }})' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
BLACK_VERSION=22.6.0 | ||
|
||
pip install -U pip setuptools wheel | ||
|
||
python setup.py sdist --formats=zip | ||
pip install dist/*.zip | ||
|
||
if [ "$CHECK_FORMATTING" = "1" ]; then | ||
pip install black==${BLACK_VERSION} isort>=5 | ||
if ! black --diff setup.py src tests; then | ||
cat <<EOF | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
Formatting problems were found (listed above). To fix them, run | ||
pip install black==$BLACK_VERSION | ||
black setup.py src tests | ||
in your local checkout. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
EOF | ||
exit 1 | ||
fi | ||
|
||
# required for isort to order test imports correctly | ||
pip install -Ur test-requirements.txt | ||
|
||
if ! isort --check-only --diff . ; then | ||
cat <<EOF | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
Formatting problems were found (listed above). To fix them, run | ||
pip install isort | ||
isort . | ||
in your local checkout. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
EOF | ||
exit 1 | ||
fi | ||
exit 0 | ||
fi | ||
|
||
# Actual tests | ||
pip install -Ur test-requirements.txt | ||
|
||
pytest -W error -ra -v tests --cov --cov-config=.coveragerc | ||
|
||
bash <(curl -s https://codecov.io/bash) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.