-
Notifications
You must be signed in to change notification settings - Fork 71
118 lines (105 loc) · 3.53 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: Test
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
codestyle:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11]
steps:
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@75f3110429a8c05be0e1bf360334e4cced2b63fa # v2.3.3
with:
python-version: ${{ matrix.python-version }}
- name: Install Python ${{ matrix.python-version }} dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pycodestyle
- name: Run Python PEP8 code style checks
run: pycodestyle
pylint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11]
steps:
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@75f3110429a8c05be0e1bf360334e4cced2b63fa # v2.3.3
with:
python-version: ${{ matrix.python-version }}
- name: Install Python ${{ matrix.python-version }} dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox pylint
- name: Run Tox (pylint)
run: tox -e pylint
unit:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11]
steps:
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@75f3110429a8c05be0e1bf360334e4cced2b63fa # v2.3.3
with:
python-version: ${{ matrix.python-version }}
- name: Install Python ${{ matrix.python-version }} dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: Run Tox
run: tox -e unit
integration:
runs-on: ubuntu-latest
services:
db_test: # This will be the hostname
image: postgres:11
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: test
options: >-
--health-cmd "pg_isready -d test -U test"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
strategy:
matrix:
python-version: [3.11]
golang-version: ["^1.14.5"]
env:
MF_METADATA_DB_HOST: db_test
MF_METADATA_DB_PORT: 5432
MF_METADATA_DB_USER: test
MF_METADATA_DB_PSWD: test
MF_METADATA_DB_NAME: test
steps:
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
- uses: actions/setup-go@bfdd3570ce990073878bf10f6b2d79082de49492 # v2.2.0
with:
go-version: ${{ matrix.golang-version }}
- name: Install goose migration tool
run: go install github.com/pressly/goose/v3/cmd/goose@v3.5.3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@75f3110429a8c05be0e1bf360334e4cced2b63fa # v2.3.3
with:
python-version: ${{ matrix.python-version }}
- name: Install Python ${{ matrix.python-version }} dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: Add required test DB alias name for localhost
run: echo "127.0.0.1 db_test" | sudo tee -a /etc/hosts
- name: Run Tox
run: tox -v -e integration