-
Notifications
You must be signed in to change notification settings - Fork 112
127 lines (109 loc) · 3.69 KB
/
build.yml
File metadata and controls
127 lines (109 loc) · 3.69 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
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
# This workflow will install the dependencies, run tests and lint every push
name: Python package
permissions:
checks: write
pull-requests: write
id-token: write
contents: read
on:
push:
branches: [ master ]
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ]
env:
PYTHON: ${{ matrix.python-version }}
steps:
- name: Azure login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- uses: actions/checkout@v4
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Install Poe
run: uv tool install poethepoet
- name: EtoE Test with pytest
env:
TEST_DATABASE: ${{ secrets.TEST_DATABASE }}
TEST_BLOB: ${{ secrets.TEST_BLOB }}
ENGINE_CONNECTION_STRING: ${{ secrets.ENGINE_CONNECTION_STRING }}
APPLICATION_INSIGHTS_ENGINE_CONNECTION_STRING: https://ade.applicationinsights.io/subscriptions/12534eb3-8109-4d84-83ad-576c0d5e1d06/resourcegroups/clients_e2e_test/providers/microsoft.insights/components/kusto-e2e-app-insights
APPLICATION_INSIGHTS_TEST_DATABASE: kusto-e2e-app-insights
run: poe test --ci
- name: "Run Ruff Formatter"
run: poe check-format
id: ruff-formatter
if: always()
- name: "Run Ruff Linter"
run: poe lint
id: ruff-linter
if: always()
- name: "Run Ruff Fixes"
id: fix-ruff
if: matrix.python-version == '3.9' && failure() && (steps.ruff-formatter.outcome != 'success' || steps.ruff-linter.outcome != 'success')
run: poe fix
- uses: parkerbxyz/suggest-changes@v2
if: matrix.python-version == '3.9' && failure() && steps.fix-ruff.outcome == 'success'
with:
comment: 'Please commit the suggested changes from markdownlint.'
event: 'REQUEST_CHANGES'
- name: "Run Type Checking (Optional to passing)"
if: always()
run: poe types
continue-on-error: true
- name: "Generate Docs"
if: matrix.python-version == '3.9' && github.ref == 'refs/heads/master'
run: poe docs --ci
- name: "Upload Docs"
uses: actions/upload-pages-artifact@v3
if: matrix.python-version == '3.9' && github.ref == 'refs/heads/master'
with:
path: docs/
- name: Upload Unit Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: Unit Test Results (Python ${{ matrix.python-version }})
path: pytest*.xml
publish-test-results:
name: "Publish Unit Tests Results"
needs: build
runs-on: ubuntu-latest
if: always()
permissions:
checks: write
pull-requests: write
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: artifacts/**/*.xml
publish-docs:
name: "Publish Docs"
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4