-
Notifications
You must be signed in to change notification settings - Fork 23
96 lines (83 loc) · 2.57 KB
/
build_with_latest_indirect_deps.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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: (Non blocking) Test on latest indirect Python dependencies
on:
push:
branches: [ main, pcp-zeroconf ]
pull_request:
branches: [ main, pcp-zeroconf ]
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: 'ros_db_test'
ports:
- 15432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
zookeeper:
image: confluentinc/cp-zookeeper
env:
ZOOKEEPER_CLIENT_PORT: 32181
ZOOKEEPER_SERVER_ID: 1
kafka:
image: confluentinc/cp-kafka
ports:
- 29092:29092
- 9092:9092
env:
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092
KAFKA_BROKER_ID: 1
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:32181
KAFKA_AUTO_CREATE_TOPICS_ENABLE: true
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.11
uses: actions/setup-python@v2
with:
python-version: 3.11
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Get pip version
run: |
pip --version
- name: Install poetry
run: |
pip install poetry
- name: Update indirect dependencies to latest
run: |
rm -rf poetry.lock
poetry update
- name: Show all installed packages
run: |
poetry run pip list
- name: Lint with flake8
run: |
pip install flake8
flake8 .
- name: Test with pytest
run: |
pip install pytest pytest-cov
poetry run pytest --cov=ros tests
env:
DB_NAME: ros_db_test
DB_HOST: localhost
DB_PORT: 15432
DB_USER: postgres
DB_PASSWORD: postgres
- name: Upload coverage to codecov
uses: codecov/codecov-action@v3
with:
verbose: true
flags: unittests