-
Notifications
You must be signed in to change notification settings - Fork 12
94 lines (77 loc) · 2.87 KB
/
ci.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
name: CI
on:
# Trigger analysis when pushing in master or pull requests, and when creating
# a pull request.
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
run:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.11', '3.12']
pandas-version: ['<2','>=2']
# Pandas<2 is not supported on Python 3.12
exclude:
- python-version: '3.12'
pandas-version: '<2'
steps:
- uses: actions/checkout@v4
with:
# Disabling shallow clone is recommended for improving relevancy of sonar reporting
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install freetds-dev libsasl2-dev libpq-dev
pip install -U poetry
- name: Install oracle dependencies
run: sudo bash toucan_connectors/install_scripts/oracle.sh
- name: Install databricks dependencies
run: sudo bash toucan_connectors/install_scripts/databricks.sh
- name: Install mssql dependencies
run: sudo bash toucan_connectors/install_scripts/mssql.sh
- name: Install mssql_TLSv1_0 dependencies
run: sudo bash toucan_connectors/install_scripts/mssql_TLSv1_0.sh
- name: Install odbc dependencies
run: sudo bash toucan_connectors/install_scripts/odbc.sh
- name: Install
run: make install
- name: Install pandas ${{ matrix.pandas-version }}
run: poetry run pip install "pandas${{ matrix.pandas-version }}"
- name: Lint
run: make lint
- name: Cache docker images
id: cache-docker-images
uses: actions/cache@v4
with:
path: /var/lib/docker/overlay2
key: ${{ runner.os }}-docker-images
- name: Pulling all docker images
run: docker compose -f tests/docker-compose.yml pull
- name: test
run: make test
env:
BEARER_API_KEY: ${{ secrets.BEARER_API_KEY }}
BEARER_AIRCALL_AUTH_ID: ${{ secrets.BEARER_AIRCALL_AUTH_ID }}
# Athena
ATHENA_OUTPUT: '${{ secrets.ATHENA_OUTPUT }}'
ATHENA_DATABASE: '${{ secrets.ATHENA_DATABASE }}'
ATHENA_ACCESS_KEY_ID: '${{ secrets.ATHENA_ACCESS_KEY_ID }}'
ATHENA_SECRET_ACCESS_KEY: '${{ secrets.ATHENA_SECRET_ACCESS_KEY }}'
ATHENA_REGION: '${{ secrets.ATHENA_REGION }}'
- name: SonarCloud Scan
# Only executed for one of the tested python version and pandas version
if: ${{ always() && matrix['python-version'] == 3.11 && matrix['pandas-version'] == '<2' }}
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}