-
Notifications
You must be signed in to change notification settings - Fork 31
105 lines (103 loc) · 3.19 KB
/
run-tests.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
name: Run Tests
on:
push:
branches: [ main ]
paths-ignore:
- version.md
pull_request:
branches: [ main ]
workflow_dispatch:
workflow_call:
secrets:
TEST_SNOWFLAKE_ACCOUNT:
required: true
TEST_SNOWFLAKE_USER:
required: true
TEST_SNOWFLAKE_PASSWORD:
required: true
VAR_STORAGE_BASE_URL:
required: true
VAR_STORAGE_ROLE_ARN:
required: true
VAR_STORAGE_AWS_EXTERNAL_ID:
required: true
CODECOV_TOKEN:
required: true
jobs:
build:
runs-on: blacksmith-4vcpu-ubuntu-2204
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: useblacksmith/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Create a virtual environment
run: |
python -m venv .venv
- name: Install dependencies
run: |
source ./.venv/bin/activate
python -m pip install --upgrade pip
make install-dev
- name: Run checks (linter, code style, static type checks, tests)
run: |
source ./.venv/bin/activate
ruff check titan/
make typecheck
python -m pytest --cov=./ --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
integration:
runs-on: blacksmith-4vcpu-ubuntu-2204
strategy:
fail-fast: false
matrix:
include:
- environment: snowflake-gcp-standard
edition: standard
- environment: snowflake-aws-standard
edition: standard
- environment: snowflake-aws-enterprise
edition: enterprise
- environment: snowflake-aws-business-critical
edition: enterprise
- environment: snowflake-azure-standard
edition: standard
environment: ${{ matrix.environment }}
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: useblacksmith/setup-python@v6
with:
python-version: 3.9
- name: Create a virtual environment
run: |
python -m venv .venv
- name: Install dependencies
run: |
source ./.venv/bin/activate
python -m pip install --upgrade pip
make install-dev
- name: Run integration tests
run: |
source ./.venv/bin/activate
python -m pytest --snowflake -m "standard or ${{ matrix.edition }}" --cov=./ --cov-report=xml
env:
TEST_SNOWFLAKE_ACCOUNT: ${{ secrets.TEST_SNOWFLAKE_ACCOUNT }}
TEST_SNOWFLAKE_USER: ${{ secrets.TEST_SNOWFLAKE_USER }}
TEST_SNOWFLAKE_PASSWORD: ${{ secrets.TEST_SNOWFLAKE_PASSWORD }}
VAR_STORAGE_BASE_URL: ${{ secrets.VAR_STORAGE_BASE_URL }}
VAR_STORAGE_ROLE_ARN: ${{ secrets.VAR_STORAGE_ROLE_ARN }}
VAR_STORAGE_AWS_EXTERNAL_ID: ${{ secrets.VAR_STORAGE_AWS_EXTERNAL_ID }}
TEST_SNOWFLAKE_ROLE: ACCOUNTADMIN
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}