mirror of
https://github.com/botlabsDev/npkpy.git
synced 2026-01-27 22:57:16 +01:00
65 lines
1.7 KiB
YAML
65 lines
1.7 KiB
YAML
name: CI/CD
|
|
on:
|
|
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
|
|
codecov --token=${{ secrets.CODECOV_TOKEN }}
|
|
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
needs: tests
|
|
if: github.event_name == 'push' && github.ref == 'master'
|
|
|
|
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 test.pypi.org
|
|
uses: pypa/gh-action-pypi-publish@master
|
|
with:
|
|
password: ${{ secrets.TEST_PYPI_PASSWORD }}
|
|
repository_url: https://test.pypi.org/legacy/
|
|
|
|
- name: Release npkPy to PyPI
|
|
if: startsWith(github.event.ref, 'refs/tags')
|
|
uses: pypa/gh-action-pypi-publish@master
|
|
with:
|
|
password: ${{ secrets.PYPI_PASSWORD }}
|