-
Notifications
You must be signed in to change notification settings - Fork 2
84 lines (81 loc) · 2.73 KB
/
push.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
84
name: Test Actions
on:
pull_request:
push:
jobs:
format:
name: Formatting (with black)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.6
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Cache python environment
id: cache-env
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-formatting-black-20.8b1
- name: Install black
if: steps.cache-env.outputs.cache-hit != 'true'
run: |
pip install black==20.8b1
- name: Black Format Check
run: |
black --check didcomm_resolver
test:
name: Tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 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: Cache python environment
id: cache-env
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-testing-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
- name: Install poetry
if: steps.cache-env.outputs.cache-hit != 'true'
run: |
pip install poetry==1.1.5
- name: Setup poetry environment
id: setup-poetry-env
run: |
poetry env use $(which python)
echo "::set-output name=poetry-env::$(poetry env info --path)"
- name: Cache poetry environment
id: cache-poetry
uses: actions/cache@v2
with:
path: ${{ steps.setup-poetry-env.outputs.poetry-env }}
key: ${{ runner.os }}-poetry-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
if: steps.cache-poetry.outputs.cache-hit != 'true'
run: |
poetry install
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
poetry run pytest
integration-test:
name: Integration Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: integration tests
run: |
docker-compose -f int/docker-compose.yml run tests && docker-compose -f int/docker-compose.yml stop