mirror of
https://github.com/botlabsDev/npkpy.git
synced 2026-01-27 22:57:16 +01:00
71 lines
1.8 KiB
YAML
71 lines
1.8 KiB
YAML
name: CI/CD
|
|
on:
|
|
release:
|
|
push:
|
|
schedule:
|
|
- cron: '0 2 * * *' # run at 2 AM UTC
|
|
|
|
jobs:
|
|
tests:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- uses: actions/setup-python@v1
|
|
with:
|
|
python-version: 3.6
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements-dev.txt
|
|
pip install -e .
|
|
|
|
- name: Pylint
|
|
run: |
|
|
pip install pytest pytest-cov codecov
|
|
pylint --rcfile=.pylintrc npkpy
|
|
|
|
- name: Pytest and Coverage
|
|
run: |
|
|
pip install pytest pytest-cov codecov
|
|
pytest --cov=npkpy --cov=acceptance_test
|
|
|
|
- name: Publish to codecov
|
|
run: |
|
|
codecov --token=${{ secrets.CODECOV_TOKEN }}
|
|
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
needs: tests
|
|
if: github.event_name == 'release' || github.event_name == 'push'
|
|
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- uses: actions/setup-python@v1
|
|
with:
|
|
python-version: 3.6
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements-dev.txt
|
|
pip install -e .
|
|
|
|
- name: Build a binary wheel and a source tarball
|
|
run: |
|
|
python3 setup.py sdist bdist_wheel
|
|
|
|
|
|
- name: Release npkPy to PyPI
|
|
# if: github.event_name == 'release'
|
|
uses: pypa/gh-action-pypi-publish@master
|
|
with:
|
|
password: ${{ secrets.PYPI_PASSWORD }}
|
|
|
|
#- name: Release npkPy to test.pypi.org
|
|
# uses: pypa/gh-action-pypi-publish@master
|
|
# with:
|
|
# password: ${{ secrets.TEST_PYPI_PASSWORD }}
|
|
# repository_url: https://test.pypi.org/legacy/
|
|
|