Skip to content

Commit

Permalink
Create test.yml
Browse files Browse the repository at this point in the history
Test PopV
  • Loading branch information
canergen authored Dec 13, 2022
1 parent cd73701 commit d0cc6be
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/test.yml
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

0 comments on commit d0cc6be

Please sign in to comment.