Skip to content

Instantly share code, notes, and snippets.

@caio-vinicius
Created January 3, 2021 14:11
Show Gist options
  • Save caio-vinicius/c2ca239d7a39b93c4516d0465d5aa6e3 to your computer and use it in GitHub Desktop.
Save caio-vinicius/c2ca239d7a39b93c4516d0465d5aa6e3 to your computer and use it in GitHub Desktop.
CI Python projects
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