2020-10-12 20:37:29 +00:00
|
|
|
name: Test
|
2020-10-12 20:35:06 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ main ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ main ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
services:
|
|
|
|
redis:
|
|
|
|
image: redis
|
|
|
|
ports:
|
|
|
|
- 6379:6379
|
|
|
|
|
|
|
|
steps:
|
|
|
|
# Python & dependency installation
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: setup Python 3.8
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: 3.8
|
|
|
|
- name: install Poetry
|
2020-11-18 20:45:57 +00:00
|
|
|
uses: snok/install-poetry@v1.1.1
|
2020-10-12 20:35:06 +00:00
|
|
|
- name: cache Poetry virtualenv
|
|
|
|
uses: actions/cache@v2
|
|
|
|
id: cache
|
|
|
|
with:
|
|
|
|
path: ~/.virtualenvs/
|
|
|
|
key: poetry-${{ hashFiles('**/poetry.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
poetry-${{ hashFiles('**/poetry.lock') }}
|
|
|
|
- name: set poetry config path
|
|
|
|
run: poetry config virtualenvs.path ~/.virtualenvs
|
|
|
|
- name: install dependencies
|
|
|
|
run: poetry install
|
|
|
|
# if: steps.cache.outputs.cache-hit != 'true'
|
|
|
|
|
2020-10-12 21:49:31 +00:00
|
|
|
- name: lint with mypy
|
|
|
|
run: poetry run mypy --disallow-untyped-defs rrl.py
|
2020-10-12 20:35:06 +00:00
|
|
|
- name: lint with flake8
|
|
|
|
run: poetry run flake8 . --show-source --statistics --ignore=E203,E501
|
|
|
|
- name: pytest
|
|
|
|
run: poetry run pytest
|