-
Notifications
You must be signed in to change notification settings - Fork 4.3k
208 lines (197 loc) · 6.43 KB
/
common.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
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
202
203
204
205
206
207
208
name: main_workflow
on:
# Run a cron job every 12 hours
schedule:
- cron: '0 */12 * * *'
push:
branches:
- master
pull_request:
jobs:
lock_check:
defaults:
run:
working-directory: ./python
continue-on-error: False
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.10"]
timeout-minutes: 10
concurrency:
group: 'test:lock-check:${{ github.ref }}'
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Pipenv install requirements and check it can be locked
run: |
pip install pipenv
pipenv --clear
time pipenv install --verbose --dev --skip-lock
time pipenv run pip install -e .[all]
time pipenv lock
time pipenv run composio --help
linter_checks:
defaults:
run:
working-directory: ./python
continue-on-error: False
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.10"]
timeout-minutes: 30
concurrency:
group: 'test:linter_checks:${{ github.ref }}'
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install 'tox>=4.21,<5' tox-uv
- name: Code style check
run: |
tox -e black-diff
tox -e isort-check
tox -e flake8
- name: Pylint check
run: tox -e pylint
- name: Static type check
run: tox -e mypy
test:
defaults:
run:
working-directory: ./python
continue-on-error: False
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.9", "3.10", "3.11"]
timeout-minutes: 20
concurrency:
group: 'test:common:${{ matrix.python-version }}:${{ github.ref }}'
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
pip install 'tox>=4.21,<5' tox-uv
- name: Unittests
run: |
export COMPOSIO_API_KEY=${{ secrets.COMPOSIO_API_KEY_STAGING }}
export COMPOSIO_BASE_URL=${{ secrets.COMPOSIO_BASE_URL_STAGING }}
export FLY_API_TOKEN=${{ secrets.FLY_API_TOKEN }}
export E2B_API_KEY=${{ secrets.E2B_API_KEY_STAGING }}
tox -e test -- -m 'not e2e and not swe'
- if: matrix.python-version == '3.10'
name: Upload test results to Codecov
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Slack Notification on Failure
if: ${{ failure() && github.ref == 'refs/heads/master' && !contains(github.event.head_commit.message, 'release') && !contains(github.event.head_commit.message, 'Release') && !inputs.dont_notify }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_TECH_WEBHOOK }}
SLACK_TITLE: "Tests Failed"
SLACK_MSG_AUTHOR: ${{ inputs.author || github.actor }}
SLACK_MESSAGE: "<@viraj> <@tushar> ${{ inputs.commit_message || github.event.head_commit.message }}"
SLACK_LINK_NAMES: "true"
SLACK_COLOR: "failure"
SLACK_USERNAME: "GitHub Actions Bot"
SLACK_ICON_EMOJI: ":x:"
SLACK_FOOTER: "Failed Tests | GitHub Actions"
swe:
defaults:
run:
working-directory: ./python
continue-on-error: False
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.10"]
timeout-minutes: 20
concurrency:
group: 'test:swe:${{ matrix.python-version }}:${{ github.ref }}'
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
pip install 'tox>=4.21,<5' tox-uv
- name: Unittests
run: |
export COMPOSIO_API_KEY=${{ secrets.COMPOSIO_API_KEY_STAGING }}
export COMPOSIO_BASE_URL=${{ secrets.COMPOSIO_BASE_URL_STAGING }}
export FLY_API_TOKEN=${{ secrets.FLY_API_TOKEN }}
export E2B_API_KEY=${{ secrets.E2B_API_KEY_STAGING }}
tox -e test -- -m 'swe'
- name: Upload test results to Codecov
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
e2e:
defaults:
run:
working-directory: ./python
continue-on-error: False
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.10"]
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Install Docker Engine without containerd
run: |
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli
sudo systemctl start docker
sudo systemctl enable docker
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
pip install 'tox>=4.21,<5' tox-uv
- name: Build docker images
run: |
cd dockerfiles
make ci
- name: Unittests
run: |
export COMPOSIO_API_KEY=${{ secrets.COMPOSIO_API_KEY_STAGING }}
export COMPOSIO_BASE_URL=${{ secrets.COMPOSIO_BASE_URL_STAGING }}
export FLY_API_TOKEN=${{ secrets.FLY_API_TOKEN }}
export E2B_API_KEY=${{ secrets.E2B_API_KEY_STAGING }}
tox -e test -- -m 'e2e'