-
Notifications
You must be signed in to change notification settings - Fork 1
201 lines (168 loc) · 5.11 KB
/
ci.yml
File metadata and controls
201 lines (168 loc) · 5.11 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
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
lint:
timeout-minutes: 10
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rye
run: |
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'
- name: Install dependencies
run: make build && make install-dev
- name: Run linting
run: make lint-all
build:
timeout-minutes: 10
name: build
runs-on: ubuntu-latest
needs: [lint]
steps:
- uses: actions/checkout@v4
- name: Install Rye
run: |
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'
- name: Install dependencies
run: make install-dev
- name: Build package
run: make build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
test:
timeout-minutes: 20
name: test
runs-on: ubuntu-latest
needs: [lint, build]
steps:
- uses: actions/checkout@v4
- name: Install Rye
run: |
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'
- name: Install dependencies
run: make install-dev
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Run tests with coverage
run: make test
- name: Upload coverage artifacts
uses: actions/upload-artifact@v4
with:
name: coverage
path: |
.coverage
htmlcov/
coverage.xml
coverage.json
docs:
timeout-minutes: 10
name: docs
runs-on: ubuntu-latest
needs: [lint, build, test]
if: github.event_name == 'pull_request' && github.base_ref == 'main' || github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Install Rye
run: |
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'
- name: Install dependencies
run: make install-dev
- name: Build documentation
run: make docs
- name: Check documentation links
run: make docs-linkcheck
- name: Upload documentation artifacts
uses: actions/upload-artifact@v4
with:
name: docs
path: docs/_build/html/
coverage-badge:
timeout-minutes: 5
name: coverage-badge
runs-on: ubuntu-latest
needs: [test]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Download coverage artifacts
uses: actions/download-artifact@v4
with:
name: coverage
path: .
- name: Update Coverage Badge
uses: we-cli/coverage-badge-action@main
with:
coverage-file: coverage.json
test-examples:
timeout-minutes: 20
name: test-examples
runs-on: ubuntu-latest
needs: [test]
if: github.event_name == 'pull_request' && github.base_ref == 'main' || github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Install Rye
run: |
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'
- name: Install dependencies
run: make install-dev
- name: Run basic examples
env:
EVOLUTION_KEY_ID: ${{ secrets.EVOLUTION_KEY_ID }}
EVOLUTION_SECRET: ${{ secrets.EVOLUTION_SECRET }}
EVOLUTION_BASE_URL: ${{ secrets.EVOLUTION_BASE_URL }}
run: make run-examples
- name: Run async examples
env:
EVOLUTION_KEY_ID: ${{ secrets.EVOLUTION_KEY_ID }}
EVOLUTION_SECRET: ${{ secrets.EVOLUTION_SECRET }}
EVOLUTION_BASE_URL: ${{ secrets.EVOLUTION_BASE_URL }}
run: make run-async
- name: Run streaming examples
env:
EVOLUTION_KEY_ID: ${{ secrets.EVOLUTION_KEY_ID }}
EVOLUTION_SECRET: ${{ secrets.EVOLUTION_SECRET }}
EVOLUTION_BASE_URL: ${{ secrets.EVOLUTION_BASE_URL }}
run: make run-streaming
- name: Run token management examples
env:
EVOLUTION_KEY_ID: ${{ secrets.EVOLUTION_KEY_ID }}
EVOLUTION_SECRET: ${{ secrets.EVOLUTION_SECRET }}
EVOLUTION_BASE_URL: ${{ secrets.EVOLUTION_BASE_URL }}
run: make run-tokens