2019-10-27 14:28:33 +01:00
|
|
|
name: Testing your PR
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
2019-11-15 23:19:47 +01:00
|
|
|
schedule:
|
|
|
|
- cron: 7 3 * * *
|
2019-10-27 14:28:33 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
pytest:
|
|
|
|
name: pytest
|
|
|
|
runs-on: ${{matrix.os}}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
python-version: [2.7, 3.5, 3.6, 3.7]
|
|
|
|
os: [ubuntu-latest, windows-latest]
|
|
|
|
include:
|
|
|
|
- os: ubuntu-latest
|
|
|
|
python-version: 3.7
|
|
|
|
test-build: True
|
|
|
|
- os: windows-latest
|
|
|
|
python-version: 3.7
|
|
|
|
test-build: True
|
|
|
|
fail-fast: False
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Initialize vendored libs
|
|
|
|
run:
|
|
|
|
git submodule update --init --recursive
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
|
|
uses: actions/setup-python@v1
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2019-11-09 19:33:51 +01:00
|
|
|
python -W ignore -m pip install --upgrade pip
|
|
|
|
python -W ignore -m pip install -U codecov pytest-cov
|
|
|
|
python -W ignore -m pip install -r requirements.txt
|
|
|
|
python -W ignore -m pip install -r requirements-dev.txt
|
2019-10-27 14:28:33 +01:00
|
|
|
|
|
|
|
- name: Test with pytest
|
|
|
|
run: |
|
|
|
|
pytest -v -m nocoverage
|
|
|
|
nocov_exit=$?
|
|
|
|
pytest -v -m "not nocoverage" --cov
|
|
|
|
cov_exit=$?
|
|
|
|
global_exit=$(( nocov_exit > cov_exit ? nocov_exit : cov_exit ))
|
|
|
|
exit ${global_exit}
|
|
|
|
env:
|
|
|
|
JOB_INDEX: ${{ strategy.job-index }}
|
2019-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ZW50X3Byb3ZpZGVyX3Rva2VuIjogIjI4NDY4NTA2MzpURVNUOlpEaGxOekU1TURrd1lXSmkiLCAiYm90X25hbWUiOiAiUFRCIHRlc3RzIG9uIEFwcFZleW9yIHVzaW5nIENQeXRob24gMy40IiwgImJvdF91c2VybmFtZSI6ICJAcHRiX2FwcHZleW9yX2NweXRob25fMzRfYm90In0sIHsidG9rZW4iOiAiNjk0MzA4MDUyOkFBRUIyX3NvbkNrNTVMWTlCRzlBTy1IOGp4aVBTNTVvb0JBIiwgInBheW1lbnRfcHJvdmlkZXJfdG9rZW4iOiAiMjg0Njg1MDYzOlRFU1Q6WW1aaVlXWm1NakpoWkdNeSIsICJib3RfbmFtZSI6ICJQVEIgdGVzdHMgb24gQXBwVmV5b3IgdXNpbmcgQ1B5dGhvbiAyLjciLCAiYm90X3VzZXJuYW1lIjogIkBwdGJfYXBwdmV5b3JfY3B5dGhvbl8yN19ib3QifV0=
|
2019-10-27 14:28:33 +01:00
|
|
|
TEST_BUILD: ${{ matrix.test-build }}
|
|
|
|
TEST_PRE_COMMIT: ${{ matrix.test-pre-commit }}
|
|
|
|
shell: bash --noprofile --norc {0}
|
|
|
|
|
|
|
|
- name: Submit coverage
|
|
|
|
run: |
|
|
|
|
if [ "$CODECOV_TOKEN" != "" ]; then
|
|
|
|
codecov -F github -t $CODECOV_TOKEN --name "${{ matrix.os }}-${{ matrix.python-version }}"
|
|
|
|
fi
|
|
|
|
env:
|
|
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
shell: bash
|
2019-11-09 21:38:23 +01:00
|
|
|
test_official:
|
|
|
|
name: test-official
|
|
|
|
runs-on: ${{matrix.os}}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
python-version: [3.7]
|
|
|
|
os: [ubuntu-latest]
|
|
|
|
fail-fast: False
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Initialize vendored libs
|
|
|
|
run:
|
|
|
|
git submodule update --init --recursive
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
|
|
uses: actions/setup-python@v1
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
python -W ignore -m pip install --upgrade pip
|
|
|
|
python -W ignore -m pip install -r requirements.txt
|
|
|
|
python -W ignore -m pip install -r requirements-dev.txt
|
|
|
|
- name: Compare to official api
|
|
|
|
run: |
|
|
|
|
pytest -v tests/test_official.py
|
|
|
|
exit $?
|
|
|
|
env:
|
|
|
|
TEST_OFFICIAL: "true"
|
|
|
|
shell: bash --noprofile --norc {0}
|
2019-11-15 22:35:44 +01:00
|
|
|
test_pre_commit:
|
|
|
|
name: test-pre-commit
|
|
|
|
runs-on: ${{matrix.os}}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
python-version: [3.7]
|
|
|
|
os: [ubuntu-latest]
|
|
|
|
fail-fast: False
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Initialize vendored libs
|
|
|
|
run:
|
|
|
|
git submodule update --init --recursive
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
|
|
uses: actions/setup-python@v1
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
python -W ignore -m pip install --upgrade pip
|
|
|
|
python -W ignore -m pip install -r requirements.txt
|
|
|
|
python -W ignore -m pip install -r requirements-dev.txt
|
|
|
|
- name: Run pre-commit tests
|
|
|
|
run: pre-commit run --all-files
|