-
Notifications
You must be signed in to change notification settings - Fork 79
166 lines (140 loc) · 4.14 KB
/
ci.yaml
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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Create .env file
uses: SpicyPizza/[email protected]
with:
envkey_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
envkey_UNSTRUCTURED_API_KEY: ${{ secrets.UNSTRUCTURED_API_KEY }}
envkey_PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
envkey_PINECONE_CLOUD: ${{ secrets.PINECONE_CLOUD }}
envkey_PINECONE_REGION: ${{ secrets.PINECONE_REGION }}
- name: Build
uses: docker/bake-action@v4
with:
set: |
*.cache-from=type=gha
*.cache-to=type=gha,mode=max
targets: dynamiq-app
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Run pre-commit
uses: pre-commit/[email protected]
with:
extra_args: --all-files --show-diff-on-failure --color always
env:
SKIP: 'no-commit-to-branch'
- name: Run conventional commits checker
uses: opensource-nepal/[email protected]
test:
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Create .env file
uses: SpicyPizza/[email protected]
with:
envkey_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
envkey_UNSTRUCTURED_API_KEY: ${{ secrets.UNSTRUCTURED_API_KEY }}
envkey_PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
envkey_PINECONE_CLOUD: ${{ secrets.PINECONE_CLOUD }}
envkey_PINECONE_REGION: ${{ secrets.PINECONE_REGION }}
- name: Load Image
uses: docker/bake-action@v4
with:
load: true
set: |
*.cache-from=type=gha
*.cache-to=type=gha,mode=max
targets: dynamiq-app-test
- name: Test
run: docker compose up dynamiq-app-test-cov --exit-code-from dynamiq-app-test-cov
- uses: actions/upload-artifact@v4
with:
name: coverage_report
path: ./reports
coverage:
needs:
- test
runs-on: ubuntu-latest
permissions:
contents: write
checks: write
pull-requests: write
steps:
- uses: actions/download-artifact@v4
with:
name: coverage_report
path: reports
- name: Produce the coverage report
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-xml-coverage-path: ./reports/coverage.xml
junitxml-path: ./reports/test-results.xml
create-new-comment: false
build-mkdocs:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Poetry
uses: snok/[email protected]
with:
version: 1.8.3
virtualenvs-create: false
- name: Install dependencies
run: make install-dependencies-dev
- name: Build MkDocs
run: make build-mkdocs
publish-updated-mkdocs:
runs-on: ubuntu-latest
permissions:
contents: write
needs: build-mkdocs
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Poetry
uses: snok/[email protected]
with:
version: 1.8.3
virtualenvs-create: false
- name: Install dependencies
run: make install-dependencies-dev
- name: Publish Updated MkDocs
run: make publish-mkdocs