-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test PopV
- Loading branch information
Showing
1 changed file
with
72 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: popv | ||
|
||
on: | ||
push: | ||
branches: [main, can-refactored] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
strategy: | ||
matrix: | ||
python-version: ["3.7", "3.8", "3.9"] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Cache pip | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-v1-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip-v1- | ||
- name: Install dependencies | ||
id: dependencies | ||
run: | | ||
pip install pytest-cov | ||
pip install .[dev,pymde,autotune] | ||
# Following checks are independent and are run even if one fails | ||
- name: Lint with flake8 | ||
run: | | ||
flake8 | ||
if: ${{ steps.dependencies.outcome == 'success' && always() }} | ||
|
||
- name: Format with black | ||
run: | | ||
black --check . | ||
if: ${{ steps.dependencies.outcome == 'success' && always() }} | ||
|
||
- name: Import sort | ||
run: | | ||
isort --check-only . | ||
if: ${{ steps.dependencies.outcome == 'success' && always() }} | ||
|
||
- name: Test with pytest | ||
run: | | ||
pytest --cov-report=xml --cov= | ||
--internet-tests --color=yes | ||
if: ${{ steps.dependencies.outcome == 'success' && always() }} | ||
# -------------------------------------------------------------- | ||
|
||
- name: After success | ||
run: | | ||
codecov | ||
pip list | ||
- name: Codacy upload | ||
env: | ||
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} | ||
run: | | ||
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -l Python -r coverage.xml | ||
continue-on-error: true |