無くなってた #87
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
name: Python-CI | |
on: | |
push: | |
branches: | |
- "*" | |
tags: | |
- "v*" | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
env: | |
GO111MODULE: "on" | |
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig/ | |
LD_LIBRARY_PATH: /opt/oracle/instantclient | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# os: [ubuntu-latest, macos-latest, windows-latest] | |
os: [ubuntu-latest, macos-latest] | |
# python-version: [3.6, 3.7, 3.8, pypy3] | |
python-version: [3.6, 3.7, 3.8] | |
exclude: | |
- os: macos-latest | |
python-version: 3.6 | |
- os: macos-latest | |
python-version: 3.7 | |
- os: macos-latest | |
python-version: pypy3 | |
# - os: windows-latest | |
# python-version: 3.6 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Display Python version | |
shell: bash | |
run: python -c "import sys; print(sys.version)" | |
- name: Install CI tools | |
shell: bash | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r ./.github/workflows/requirements.txt | |
pip list --verbose | |
# https://github.com/timothycrosley/isort | |
- name: Exec isort | |
shell: bash | |
run: | | |
python -m isort --check --force-sort-within-sections --verbose ./src/rest.py || : | |
# https://github.com/psf/black | |
- name: Exec black | |
shell: bash | |
run: | | |
black --version | |
black -v --check --diff src/ | |
# https://gitlab.com/pycqa/flake8 | |
- name: Exec flake8 | |
if: matrix.python-version == '3.8' | |
run: | | |
flake8 --version | |
flake8 --ignore=F401 --exclude tests --max-line-length 100 src/ | |
# https://github.com/python/mypy | |
- name: Exec mypy | |
shell: bash | |
if: matrix.python-version == '3.8' | |
run: | | |
mypy --version | |
python3 -m mypy src/calc.py | |
test: | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install CI tools | |
shell: bash | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest pytest-cov | |
# https://github.com/pytest-dev/pytest | |
- name: Exec Pytest | |
shell: bash | |
run: | | |
pytest --cache-clear --verbose --full-trace src/ | |
if [[ $? -ne 0 ]]; then pytest --cache-clear --verbose --full-trace --setup-show src/; fi | |
pytest -v --cov=src/ --cov-report xml | |
# https://github.com/codecov/codecov-action | |
- name: Upload Code Coverage | |
uses: codecov/codecov-action@v1 | |
# if: matrix.python-version == '3.8' && matrix.os == 'ubuntu-latest' | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./coverage.xml | |
flags: unittests | |
name: codecov-umbrella | |
fail_ci_if_error: true |