-
Notifications
You must be signed in to change notification settings - Fork 4
83 lines (69 loc) · 1.94 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Test
on:
pull_request: {}
push:
branches: master
tags: "*"
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [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: Install poetry
run: |
curl -sSL \
"https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py" | python
- name: Set up cache
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
run: |
source "$HOME/.poetry/env"
poetry config virtualenvs.in-project true
poetry install
# sudo apt install python3-bs4
- name: Run checks
run: |
source "$HOME/.poetry/env"
export PATH="$(pwd)/.venv/bin:$PATH"
make test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies with pipenv
run: |
pip install pipenv
pipenv install --deploy --dev
- run: pipenv run isort --recursive --diff .
- run: pipenv run black --check .
- run: pipenv run flake8
# - run: pipenv run mypy
- run: pipenv run pytest --cov --cov-fail-under=50
docker-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build docker image
run: docker build . -t topalias:test
- name: Smoke test docker image
run: |
docker run --rm topalias:test