Created
January 3, 2021 14:11
-
-
Save caio-vinicius/c2ca239d7a39b93c4516d0465d5aa6e3 to your computer and use it in GitHub Desktop.
CI Python projects
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
name: CI Pytest and Flake8 | |
on: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- '**.py' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.8] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest flake8 | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Linter with Flake8 | |
run: | | |
flake8 --count --show-source --statistics | |
- name: Test with pytest | |
env: | |
run: | | |
pytest -v |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment