Merge pull request #6 from r3w0p/1.1 #135
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: CICD | |
on: | |
push: | |
branches: | |
- 'main' | |
tags-ignore: | |
- '**' | |
jobs: | |
ci: | |
name: CI | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: [ "3.9", "3.10" ] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install -r requirements-dev.txt | |
- name: Lint with flake8 | |
run: | | |
# Stop the build if there are Python syntax errors or undefined names | |
flake8 ./bobocep --count --select=E9,F63,F7,F82 --show-source --statistics | |
flake8 ./tests --count --select=E9,F63,F7,F82 --show-source --statistics | |
- name: Type check with mypy | |
run: | | |
mypy ./bobocep | |
mypy ./tests | |
- name: Code coverage with coverage and pytest | |
run: | | |
coverage run --source=bobocep -m pytest tests | |
coverage report --fail-under=98 | |
- name: Documentation coverage with interrogate | |
run: | | |
interrogate -vv bobocep --fail-under 100 | |
- name: Upload code coverage to Code Climate | |
uses: paambaati/[email protected] | |
env: | |
CC_TEST_REPORTER_ID: ${{ secrets.CODE_CLIMATE_TEST_REPORTER_ID }} | |
with: | |
coverageCommand: coverage xml | |
cd: | |
name: CD | |
needs: ci | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest ] | |
python-version: [ "3.9" ] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install pypa/build | |
run: >- | |
python -m | |
pip install | |
build | |
--user | |
- name: Build binary wheel and source tarball | |
run: >- | |
python -m | |
build | |
--sdist | |
--wheel | |
--outdir dist/ | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_TOKEN }} |