Skip to content

Commit c8b43cb

Browse files
authored
chore(ci/cd): migrate to buddy ci (#142)
1 parent a4dfeff commit c8b43cb

File tree

10 files changed

+7148
-125
lines changed

10 files changed

+7148
-125
lines changed

.buddy/cd.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
- pipeline: cd
2+
name: CD
3+
refs:
4+
- refs/heads/master
5+
events:
6+
- type: PUSH
7+
fail_on_prepare_env_warning: true
8+
description_required: true
9+
variables:
10+
- key: GH_TOKEN
11+
value: $GH_TOKEN_PUBLIC_PACKAGES
12+
actions:
13+
- action: Semantic Release
14+
type: BUILD
15+
docker_image_name: library/node
16+
docker_image_tag: 18.20.8
17+
execute_commands:
18+
19+
- npx semantic-release
20+
cached_dirs:
21+
- /root/.cache/pip
22+
shell: BASH
23+
- action: Publish to PyPI
24+
type: BUILD
25+
disabled: true
26+
docker_image_name: library/python
27+
docker_image_tag: 3.13
28+
execute_commands:
29+
- pip install build twine
30+
- python -m build
31+
- twine upload dist/* -u __token__ -p $PYPI_PASSWORD
32+
cached_dirs:
33+
- /root/.cache/pip
34+
shell: BASH

.buddy/ci.yml

Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
- pipeline: ci
2+
name: CI
3+
refs:
4+
- refs/heads/*
5+
events:
6+
- type: PUSH
7+
actions:
8+
- action: Linting
9+
type: BUILD
10+
docker_image_name: library/python
11+
docker_image_tag: 3.13
12+
execute_commands:
13+
- python -m venv venv
14+
- source venv/bin/activate
15+
- "pip install -e '.[dev]'"
16+
- make format args='--check'
17+
cached_dirs:
18+
- /root/.cache/pip
19+
shell: BASH
20+
- action: Python 3.10.x - Tests
21+
type: BUILD
22+
docker_image_name: library/python
23+
docker_image_tag: 3.10.18
24+
execute_commands:
25+
- "# Set Firefox environment variables to help with headless operation"
26+
- Xvfb :99 -screen 0 1280x1024x24 &
27+
- export DISPLAY=:99.0
28+
- export MOZ_HEADLESS=1
29+
- export MOZ_NO_REMOTE=1
30+
- "export PATH=${HOME}/firefox-latest-smartcar/firefox:$PATH"
31+
- firefox --version
32+
- firefox -headless &
33+
- ""
34+
- "# Run Tests"
35+
- python -m venv venv
36+
- source venv/bin/activate
37+
- "pip install -e '.[dev]'"
38+
- ""
39+
- make test
40+
- ""
41+
setup_commands:
42+
- apt-get update
43+
- apt-get install -y \
44+
- ' libgtk-3-0 \'
45+
- ' libasound2 \'
46+
- ' libdbus-glib-1-2 \'
47+
- ' libx11-xcb1 \'
48+
- ' libxt6 \'
49+
- ' libnss3 \'
50+
- ' libxtst6 \'
51+
- ' libxss1 \'
52+
- ' libpci3 \'
53+
- ' libatk1.0-0 \'
54+
- ' libatk-bridge2.0-0 \'
55+
- ' libcups2 \'
56+
- ' libdrm2 \'
57+
- ' libxcomposite1 \'
58+
- ' libxdamage1 \'
59+
- ' libxfixes3 \'
60+
- ' libxkbcommon0 \'
61+
- ' libxrandr2 \'
62+
- ' xvfb'
63+
- ""
64+
- ""
65+
- "# Download the latest Firefox"
66+
- wget -O /tmp/firefox-latest.tar.xz 'https://download.mozilla.org/?product=firefox-latest&lang=en-US&os=linux64'
67+
- "mkdir -p ${HOME}/firefox-latest-smartcar"
68+
- "tar -xJf /tmp/firefox-latest.tar.xz -C ${HOME}/firefox-latest-smartcar"
69+
- rm /tmp/firefox-latest.tar.xz
70+
cached_dirs:
71+
- /root/.cache/pip
72+
shell: BASH
73+
- action: Python 3.11.x - Tests
74+
type: BUILD
75+
docker_image_name: library/python
76+
docker_image_tag: 3.11.13
77+
execute_commands:
78+
- "# Set Firefox environment variables to help with headless operation"
79+
- Xvfb :99 -screen 0 1280x1024x24 &
80+
- export DISPLAY=:99.0
81+
- export MOZ_HEADLESS=1
82+
- export MOZ_NO_REMOTE=1
83+
- "export PATH=${HOME}/firefox-latest-smartcar/firefox:$PATH"
84+
- firefox --version
85+
- firefox -headless &
86+
- ""
87+
- "# Run Tests"
88+
- python -m venv venv
89+
- source venv/bin/activate
90+
- "pip install -e '.[dev]'"
91+
- ""
92+
- make test
93+
- ""
94+
setup_commands:
95+
- apt-get update
96+
- apt-get install -y \
97+
- ' libgtk-3-0 \'
98+
- ' libasound2 \'
99+
- ' libdbus-glib-1-2 \'
100+
- ' libx11-xcb1 \'
101+
- ' libxt6 \'
102+
- ' libnss3 \'
103+
- ' libxtst6 \'
104+
- ' libxss1 \'
105+
- ' libpci3 \'
106+
- ' libatk1.0-0 \'
107+
- ' libatk-bridge2.0-0 \'
108+
- ' libcups2 \'
109+
- ' libdrm2 \'
110+
- ' libxcomposite1 \'
111+
- ' libxdamage1 \'
112+
- ' libxfixes3 \'
113+
- ' libxkbcommon0 \'
114+
- ' libxrandr2 \'
115+
- ' xvfb'
116+
- ""
117+
- ""
118+
- "# Download the latest Firefox"
119+
- wget -O /tmp/firefox-latest.tar.xz 'https://download.mozilla.org/?product=firefox-latest&lang=en-US&os=linux64'
120+
- "mkdir -p ${HOME}/firefox-latest-smartcar"
121+
- "tar -xJf /tmp/firefox-latest.tar.xz -C ${HOME}/firefox-latest-smartcar"
122+
- rm /tmp/firefox-latest.tar.xz
123+
cached_dirs:
124+
- /root/.cache/pip
125+
shell: BASH
126+
- action: Python 3.12.x - Tests
127+
type: BUILD
128+
docker_image_name: library/python
129+
docker_image_tag: 3.12.12
130+
execute_commands:
131+
- "# Set Firefox environment variables to help with headless operation"
132+
- Xvfb :99 -screen 0 1280x1024x24 &
133+
- export DISPLAY=:99.0
134+
- export MOZ_HEADLESS=1
135+
- export MOZ_NO_REMOTE=1
136+
- "export PATH=${HOME}/firefox-latest-smartcar/firefox:$PATH"
137+
- firefox --version
138+
- firefox -headless &
139+
- ""
140+
- "# Run Tests"
141+
- python -m venv venv
142+
- source venv/bin/activate
143+
- "pip install -e '.[dev]'"
144+
- ""
145+
- make test
146+
- ""
147+
setup_commands:
148+
- apt-get update
149+
- apt-get install -y \
150+
- ' libgtk-3-0 \'
151+
- ' libasound2 \'
152+
- ' libdbus-glib-1-2 \'
153+
- ' libx11-xcb1 \'
154+
- ' libxt6 \'
155+
- ' libnss3 \'
156+
- ' libxtst6 \'
157+
- ' libxss1 \'
158+
- ' libpci3 \'
159+
- ' libatk1.0-0 \'
160+
- ' libatk-bridge2.0-0 \'
161+
- ' libcups2 \'
162+
- ' libdrm2 \'
163+
- ' libxcomposite1 \'
164+
- ' libxdamage1 \'
165+
- ' libxfixes3 \'
166+
- ' libxkbcommon0 \'
167+
- ' libxrandr2 \'
168+
- ' xvfb'
169+
- ""
170+
- ""
171+
- "# Download the latest Firefox"
172+
- wget -O /tmp/firefox-latest.tar.xz 'https://download.mozilla.org/?product=firefox-latest&lang=en-US&os=linux64'
173+
- "mkdir -p ${HOME}/firefox-latest-smartcar"
174+
- "tar -xJf /tmp/firefox-latest.tar.xz -C ${HOME}/firefox-latest-smartcar"
175+
- rm /tmp/firefox-latest.tar.xz
176+
cached_dirs:
177+
- /root/.cache/pip
178+
shell: BASH
179+
- action: Python 3.12.x - Tests OLD
180+
type: BUILD
181+
disabled: true
182+
docker_image_name: library/python
183+
docker_image_tag: 3.12.11
184+
execute_commands:
185+
- "# Set Firefox environment variables to help with headless operation"
186+
- Xvfb :99 -screen 0 1280x1024x24 &
187+
- export DISPLAY=:99.0
188+
- export MOZ_HEADLESS=1
189+
- export MOZ_NO_REMOTE=1
190+
- "export PATH=${HOME}/firefox-latest-smartcar/firefox:$PATH"
191+
- firefox --version
192+
- firefox -headless &
193+
- ""
194+
- "# Run Tests"
195+
- python -m venv venv
196+
- source venv/bin/activate
197+
- "pip install -e '.[dev]'"
198+
- ""
199+
- make test
200+
- ""
201+
setup_commands:
202+
- apt-get update
203+
- apt-get install -y \
204+
- ' libgtk-3-0 \'
205+
- ' libasound2 \'
206+
- ' libdbus-glib-1-2 \'
207+
- ' libx11-xcb1 \'
208+
- ' libxt6 \'
209+
- ' libnss3 \'
210+
- ' libxtst6 \'
211+
- ' libxss1 \'
212+
- ' libpci3 \'
213+
- ' libatk1.0-0 \'
214+
- ' libatk-bridge2.0-0 \'
215+
- ' libcups2 \'
216+
- ' libdrm2 \'
217+
- ' libxcomposite1 \'
218+
- ' libxdamage1 \'
219+
- ' libxfixes3 \'
220+
- ' libxkbcommon0 \'
221+
- ' libxrandr2 \'
222+
- ' xvfb'
223+
- ""
224+
- ""
225+
- "# Download the latest Firefox"
226+
- wget -O /tmp/firefox-latest.tar.xz 'https://download.mozilla.org/?product=firefox-latest&lang=en-US&os=linux64'
227+
- "mkdir -p ${HOME}/firefox-latest-smartcar"
228+
- "tar -xJf /tmp/firefox-latest.tar.xz -C ${HOME}/firefox-latest-smartcar"
229+
- rm /tmp/firefox-latest.tar.xz
230+
cached_dirs:
231+
- /root/.cache/pip
232+
shell: BASH
233+

.travis.yml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ addons:
99
language: python
1010

1111
python:
12-
- '3.8'
1312
- '3.9'
1413
- '3.10'
1514
- '3.11'
@@ -33,23 +32,3 @@ script:
3332
- make test
3433
- make format args='--check'
3534

36-
jobs:
37-
include:
38-
- stage: publish
39-
python: '3.11'
40-
services: []
41-
addons:
42-
firefox: 'skip'
43-
apt: []
44-
install:
45-
- nvm install 18
46-
47-
script:
48-
- npx semantic-release
49-
deploy:
50-
provider: pypi
51-
skip_cleanup: true
52-
username: $PYPI_USERNAME
53-
password: $PYPI_PASSWORD
54-
on:
55-
branch: master

CONTRIBUTING.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,20 @@ Please be sure to read the contribution guidelines before making or requesting a
1515

1616
To run tests, you will need the appropriate WebDriver for your chosen browser. This guide assumes you are using either Firefox or Chrome:
1717

18+
### Firefox
1819
- For Firefox, download [geckodriver](https://github.com/mozilla/geckodriver/releases).
20+
21+
#### Set up a local firefox specifically for testing
22+
23+
```
24+
# Create a firefox binary for smartcar tests in home directory
25+
wget -O /tmp/firefox-latest.tar.xz 'https://download.mozilla.org/?product=firefox-latest&lang=en-US&os=linux64'
26+
mkdir -p ${HOME}/firefox-latest-smartcar
27+
tar -xJf /tmp/firefox-latest.tar.xz -C ${HOME}/firefox-latest-smartcar
28+
rm /tmp/firefox-latest.tar.xz
29+
```
30+
31+
### Chrome
1932
- For Chrome, download [chromedriver](https://chromedriver.chromium.org/downloads).
2033

2134
Ensure that the chosen driver is in your system's PATH, or you can specify the path directly in your test scripts.

0 commit comments

Comments
 (0)