-
Notifications
You must be signed in to change notification settings - Fork 678
67 lines (55 loc) · 1.6 KB
/
ci.yaml
File metadata and controls
67 lines (55 loc) · 1.6 KB
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
name: Python Connectors CI
on:
push:
branches:
- master
workflow_dispatch:
jobs:
detect-clients:
runs-on: ubuntu-latest
outputs:
clients: ${{ steps.detect.outputs.clients }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Detect all clients
id: detect
run: |
ALL_CLIENTS=$(ls -d clients/*/ | xargs -n 1 basename | jq -R -s -c 'split("\n")[:-1]')
echo "Detected clients: $ALL_CLIENTS"
echo "clients=$ALL_CLIENTS" >> $GITHUB_ENV
echo "::set-output name=clients::$ALL_CLIENTS"
build:
needs: detect-clients
runs-on: ubuntu-latest
strategy:
matrix:
client: ${{ fromJson(needs.detect-clients.outputs.clients) }}
python-version: ["3.12"]
poetry-version: ["1.8.4"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
pip3 install --upgrade pip && \
pip3 install ruff black && \
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Build ${{ matrix.client }} client
run: |
if [ "${{ matrix.client }}" == "common" ]; then
cd common
else
cd clients/${{ matrix.client }}
fi
# Install dependencies
poetry install
# Format
poetry run black .
# Lint
poetry run ruff check --fix .
# Test
poetry run pytest tests
# Build
poetry build