.github/workflows/main.yml
# This is a basic workflow to help you get started with Actions
name: CI-Test
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the develop branch
pull_request:
branches:
- develop
- master
- release/*
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Check out repository code
uses: actions/checkout@v2
# Setup Python (faster than using Python container)
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.7"
- name: Install pipenv
run: |
python -m pip install --upgrade pipenv wheel
- id: cache-pipenv
uses: actions/cache@v2
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
- name: Install dependencies
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: pipenv install --deploy --dev
- name: Run tests
run: |
pipenv run coverage run --source=app -m unittest discover -s tests/ -v
pipenv run coverage report
pipenv run coverage xml
- name: Upload reports to Codecov
run: bash <(curl -s https://codecov.io/bash) -Z