-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.cirrus.yml
183 lines (175 loc) · 5.38 KB
/
.cirrus.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
Lint_task:
persistent_worker: &linux
isolation:
container:
image: python:3.12-slim
cpu: 1
memory: 512Mi
install_script:
- pip install -U --upgrade-strategy eager pip 'setuptools>61'
- pip install .
- pip install .[lint] .[test]
script:
- ruff --version
- mypy --version
- bork run lint
Linux_task:
persistent_worker: &linuxes
isolation:
container:
cpu: 1
memory: 512Mi
matrix:
- image: python:3.10-slim
- image: python:3.11-slim
- image: python:3.12-slim
- image: python:3.13-rc-slim
install_script:
- apt-get update
- apt-get install -y git
- pip install -U --upgrade-strategy eager pip 'setuptools>61'
- pip install . .[test]
version_script:
- python3 --version
matrix:
- alias: Linux quick
script: bork run test-fast
- alias: Linux slow
depends_on: [Linux quick]
script: bork run test-slow
always:
upload_results_artifacts:
path: ./bork-junit.xml
format: junit
type: text/xml
macOS_task:
alias: macOS tests
skip: true
macos_instance:
cpu: 1
image: ghcr.io/cirruslabs/macos-runner:sonoma
env:
PATH: ${HOME}/.pyenv/shims:${PATH}
PYTHON: 3:latest
brew_update_script:
- brew update
brew_install_script:
# Per the pyenv homebrew recommendations.
# https://github.com/pyenv/pyenv/wiki#suggested-build-environment
- brew install pyenv git
pyenv_install_script:
- pyenv install ${PYTHON}
- pyenv global 3
- pyenv rehash
pip_install_script:
- pip install -U --upgrade-strategy eager pip 'setuptools>61'
- pip install .[test]
script:
- python3 --version
- bork run test
always:
upload_results_artifacts:
path: ./bork-junit.xml
format: junit
type: text/xml
FreeBSD_task:
alias: FreeBSD tests
skip: true
freebsd_instance:
image_family: freebsd-14-0
env:
matrix:
- PYTHON: 3.10
- PYTHON: 3.11
# TODO: PYTHON: 3.12
install_script:
- PY=`echo $PYTHON | tr -d '.'`
- pkg install -y python${PY} git
- python${PYTHON} -m ensurepip
pip_install_script:
- python${PYTHON} -m pip install -U --upgrade-strategy eager pip 'setuptools>61'
- python${PYTHON} -m pip install .[test]
script:
- python${PYTHON} --version
- bork run test
always:
upload_results_artifacts:
path: ./bork-junit.xml
format: junit
type: text/xml
Windows_task:
skip: true
windows_container:
image: cirrusci/windowsservercore:2019
env:
matrix:
- PYTHON: 3.10.11
- PYTHON: 3.11.9
- PYTHON: 3.12.4
python_install_script:
# https://docs.python.org/3.6/using/windows.html#installing-without-ui
- ps: Invoke-WebRequest -Uri https://www.python.org/ftp/python/${env:PYTHON}/python-${env:PYTHON}-amd64.exe -OutFile C:\python-installer.exe
- C:\python-installer.exe /quiet TargetDir=C:\Python SimpleInstall=1
install_script:
- C:\Python\python.exe -m pip install -U --upgrade-strategy eager pip "setuptools>61"
- C:\Python\python.exe -m pip install .[test]
version_info_script:
- C:\Python\python.exe --version
test_script:
- C:\Python\python.exe -m pytest --verbose
always:
upload_results_artifacts:
path: ./bork-junit.xml
format: junit
type: text/xml
success_task:
name: CI success
persistent_worker:
isolation:
container: {image: "busybox"}
depends_on:
- FreeBSD tests
- Linux quick
- Linux slow
- macOS tests
- Lint
- Windows
# If bork/version.py is modified on the main branch, make a release.
Release_task:
stateful: true # we don't want the task interrupted mid-release
persistent_worker: *linux
only_if: "changesInclude('bork/version.py') && $BRANCH == 'main' && $CIRRUS_CRON == ''"
depends_on: [CI success]
env:
BORK_PYPI_USERNAME: "__token__"
BORK_PYPI_PASSWORD: ENCRYPTED[00007524e18bea7b59efea288653efa57b1dbd235ed8af00cc325febfc9076631a2bf58ed330d8fa7ca057adb81579b0]
BORK_GITHUB_TOKEN: ENCRYPTED[29eac4d276e1e86020bbc415c04ce91136508e5bdeacd756310c32ebdd3fb7f910c6ed3159f08765915d9e656964e8f5]
install_script:
- apt-get update
- apt-get install -y git
- pip install -U --upgrade-strategy eager pip 'setuptools>61'
- pip3 install . .[test]
build_script:
- bork clean
- bork build
test_script:
- bork run test
release_script:
- bork release
# If there's a new tag, which should only happen after a successful release
# to PyPi, publish an image on Docker Hub.
docker_builder:
only_if: $CIRRUS_TAG != ''
name: "Release on Docker Hub"
depends_on:
- Release
env:
DOCKER_USERNAME: ENCRYPTED[a957943032559f0859a16a4421bc3602338080e6d9ce63a980db4fd34dbdc2afbe3a20c620139c669182eced4211a515]
DOCKER_PASSWORD: ENCRYPTED[dd7f31d490b645298258ac9ec78ac3a7e034e8bfcf8fbfec0137787eef3934e01a42ef3b5eda42b1b1f7a3296fae619e]
delay_script: sleep 10 # Attempt to ensure it is available via pip.
build_script:
- docker build --tag duckinator/bork:${CIRRUS_TAG} --tag duckinator/bork:latest --build-arg "VERSION=$(echo $CIRRUS_TAG | sed 's/^v//')" .
login_script: docker login --username $DOCKER_USERNAME --password $DOCKER_PASSWORD
push_tag_script: docker push duckinator/bork:$CIRRUS_TAG
push_latest_script:
- if grep -qE "^__version__\s+=\s+['\"]([0-9.]+)['\"]$" bork/version.py; then docker push duckinator/bork:latest; fi