-
Notifications
You must be signed in to change notification settings - Fork 144
156 lines (142 loc) · 5.25 KB
/
test-integration-vizro-ai.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: Integration tests for VizroAI
defaults:
run:
working-directory: vizro-ai
on:
push:
branches: [main]
pull_request:
branches:
- main
paths:
- "vizro-ai/**"
- "!vizro-ai/docs/**"
workflow_dispatch:
env:
PYTHONUNBUFFERED: 1
FORCE_COLOR: 1
jobs:
test-integration-vizro-ai-fork:
if: ${{ github.event.pull_request.head.repo.fork }}
name: test-integration-vizro-ai on Py${{ matrix.config.python-version }} ${{ matrix.config.label }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
# This is not a nice way to define the matrix, but it's the only way that's possible so that we only run
# the job on Windows on merge to main rather than in every PR. See:
# https://stackoverflow.com/questions/66025220/paired-values-in-github-actions-matrix
# https://github.com/orgs/community/discussions/26253
# https://github.com/actions/runner/issues/1985
config:
- python-version: "3.9"
hatch-env: all.py3.9
os: ubuntu-latest
- python-version: "3.10"
hatch-env: all.py3.10
os: ubuntu-latest
- python-version: "3.11"
hatch-env: all.py3.11
os: ubuntu-latest
- python-version: "3.12"
hatch-env: all.py3.12
os: ubuntu-latest
- python-version: "3.9"
hatch-env: lower-bounds
os: ubuntu-latest
label: lower bounds
- python-version: "3.12"
hatch-env: all.py3.12
os: windows-latest
label: Windows
is_non_release_pr:
- ${{ github.event_name == 'pull_request' && !startsWith(github.head_ref, 'release')}}
exclude:
- is_non_release_pr: true
config:
python-version: "3.12"
hatch-env: all.py3.12
os: windows-latest
label: Windows
steps:
- uses: actions/checkout@v4
- name: Passed fork step
run: echo "Success!"
test-integration-vizro-ai:
if: ${{ ! github.event.pull_request.head.repo.fork }}
name: test-integration-vizro-ai on Py${{ matrix.config.python-version }} ${{ matrix.config.label }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
# This is not a nice way to define the matrix, but it's the only way that's possible so that we only run
# the job on Windows on merge to main rather than in every PR. See:
# https://stackoverflow.com/questions/66025220/paired-values-in-github-actions-matrix
# https://github.com/orgs/community/discussions/26253
# https://github.com/actions/runner/issues/1985
config:
- python-version: "3.9"
hatch-env: all.py3.9
os: ubuntu-latest
- python-version: "3.10"
hatch-env: all.py3.10
os: ubuntu-latest
- python-version: "3.11"
hatch-env: all.py3.11
os: ubuntu-latest
- python-version: "3.12"
hatch-env: all.py3.12
os: ubuntu-latest
- python-version: "3.9"
hatch-env: lower-bounds
os: ubuntu-latest
label: lower bounds
- python-version: "3.12"
hatch-env: all.py3.12
os: windows-latest
label: Windows
is_non_release_pr:
- ${{ github.event_name == 'pull_request' && !startsWith(github.head_ref, 'release')}}
exclude:
- is_non_release_pr: true
config:
python-version: "3.12"
hatch-env: all.py3.12
os: windows-latest
label: Windows
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.config.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.config.python-version }}
- name: Install Hatch
run: pip install hatch
- name: Show dependency tree
run: hatch run ${{ matrix.config.hatch-env }}:pip tree
- name: Run vizro-ai integration tests with PyPI vizro
run: hatch run ${{ matrix.config.hatch-env }}:test-integration
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_API_BASE: ${{ secrets.OPENAI_API_BASE }}
VIZRO_TYPE: pypi
- name: Run vizro-ai integration tests with local vizro
run: |
hatch run ${{ matrix.config.hatch-env }}:pip install ../vizro-core
hatch run ${{ matrix.config.hatch-env }}:test-integration
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_API_BASE: ${{ secrets.OPENAI_API_BASE }}
VIZRO_TYPE: local
- name: Send custom JSON data to Slack
id: slack
uses: slackapi/[email protected]
if: failure()
with:
payload: |
{
"text": "Vizro-ai ${{ matrix.config.hatch-env }} integration tests build result: ${{ job.status }}\nBranch: ${{ github.head_ref }}\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK