-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c91f780
commit 6ce3338
Showing
1 changed file
with
26 additions
and
21 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,40 @@ | ||
name: Python CI | ||
name: Python Package Workflow | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install dependencies | ||
run: pip install -r requirements.txt | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Run Tests | ||
run: pytest | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.x | ||
|
||
- name: Run Linters | ||
run: pylint vnstock | ||
- name: Install dependencies | ||
run: | | ||
pip install --upgrade pip | ||
pip install -r python-package/requirements.txt | ||
- name: Run Code Style Check | ||
run: flake8 vnstock | ||
- name: Run tests | ||
run: | | ||
cd python-package | ||
python -m unittest discover tests | ||
- name: Report Test Coverage | ||
run: coverage run -m pytest | ||
- name: Upload coverage to Codecov | ||
run: codecov | ||
- name: Upload to PyPI | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: | | ||
cd python-package | ||
python setup.py sdist bdist_wheel | ||
pip install twine | ||
twine upload dist/* | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} |