-
Notifications
You must be signed in to change notification settings - Fork 16
106 lines (96 loc) · 3.22 KB
/
python.yaml
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
name: Python Connectors
on:
push:
branches: [main]
paths:
- "estuary-cdk/**"
- "source-asana/**"
- "source-gladly/**"
- "source-google-sheets-native/**"
- "source-hubspot-native/**"
- "source-salesforce/**"
pull_request:
branches: [main]
paths:
- "estuary-cdk/**"
- "source-asana/**"
- "source-gladly/**"
- "source-google-sheets-native/**"
- "source-hubspot-native/**"
- "source-salesforce/**"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
py_connector:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
connector:
# Note that every entry here must specify usage_rate. We're unable to
# set a default and selectively override it with `0.0`, because GH actions
# considers zero values to be "unset" (which is bs and I'm salty about it).
- name: source-asana
type: capture
version: v1
usage_rate: "1.0"
- name: source-hubspot-native
type: capture
version: v1
usage_rate: "1.0"
- name: source-gladly
type: capture
version: v1
usage_rate: "1.0"
- name: source-google-sheets-native
type: capture
version: v1
usage_rate: "0.0"
- name: source-salesforce
type: capture
version: v2
steps:
- uses: actions/checkout@v4
- name: Common Setup
id: setup
uses: ./.github/actions/setup
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
gcp_project_id: ${{ secrets.GCP_PROJECT_ID }}
gcp_service_account_key: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Poetry
uses: snok/install-poetry@v1
- name: ${{ matrix.connector.name }} tests
run: |
cd ${{ matrix.connector.name }}
poetry install
source $(poetry env info --path)/bin/activate
cd ..
pytest ${{ matrix.connector.name }}
- name: Build ${{ matrix.connector.name }} Docker Image
uses: docker/build-push-action@v2
with:
context: .
file: estuary-cdk/common.Dockerfile
load: true
build-args: |
CONNECTOR_NAME=${{ matrix.connector.name }}
CONNECTOR_TYPE=${{ matrix.connector.type }}
USAGE_RATE=${{ matrix.connector.usage_rate }}
tags: ghcr.io/estuary/${{ matrix.connector.name }}:local
- name: Deployment
uses: ./.github/actions/deploy
with:
connector: ${{ matrix.connector.name }}
pg_database: ${{ secrets.POSTGRES_CONNECTOR_REFRESH_DATABASE }}
pg_host: ${{ secrets.POSTGRES_CONNECTOR_REFRESH_HOST }}
pg_password: ${{ secrets.POSTGRES_CONNECTOR_REFRESH_PASSWORD }}
pg_user: ${{ secrets.POSTGRES_CONNECTOR_REFRESH_USER }}
tag_sha: ${{ steps.setup.outputs.tag_sha }}
tag_version: ${{ matrix.connector.version }}
variants: ${{ matrix.connector.variants }}