-
-
Notifications
You must be signed in to change notification settings - Fork 187
/
config.yml
177 lines (167 loc) · 5.19 KB
/
config.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
version: 2.1
orbs:
docker: talkiq/docker@3
linter: talkiq/linter@4
executors:
docker-git:
docker:
- image: docker:25.0.5-git
resource_class: medium
py38:
docker:
- image: python:3.8-alpine
resource_class: small
py39:
docker:
- image: python:3.9-alpine
resource_class: small
py310:
docker:
- image: python:3.10-alpine
resource_class: small
py311:
docker:
- image: python:3.11-alpine
resource_class: small
py312:
docker:
- image: python:3.12-alpine
resource_class: small
pypy737: # py38
docker:
- image: pypy:3-7.3.7-slim
resource_class: small
pypy7311: # py38+py39
docker:
- image: pypy:3-7.3.11-slim
resource_class: small
pypy73: # py39+py310
docker:
- image: pypy:3-7.3-slim
resource_class: small
commands:
# See thekevjames/tools
custom-tag:
parameters:
ident:
type: string
default: "coveralls"
tag:
default: /tmp/custom-tag
type: string
steps:
- run: docker tag "thekevjames/<<parameters.ident>>:latest" "thekevjames/<<parameters.ident>>:$(cat <<parameters.tag>>)"
- run: docker tag "quay.io/thekevjames/<<parameters.ident>>:latest" "quay.io/thekevjames/<<parameters.ident>>:$(cat <<parameters.tag>>)"
- run: docker push "thekevjames/<<parameters.ident>>:$(cat <<parameters.tag>>)"
- run: docker push "quay.io/thekevjames/<<parameters.ident>>:$(cat <<parameters.tag>>)"
jobs:
# See thekevjames/tools
docker-publish:
executor: docker-git
parameters:
ident:
type: string
default: "coveralls"
tag:
type: string
steps:
- checkout
- setup_remote_docker
- run: echo "$DOCKER_PASS" | docker login docker.io --username "$DOCKER_USER" --password-stdin
- run: echo "$QUAY_PASS" | docker login quay.io --username "$QUAY_USER" --password-stdin
- docker/build:
local_image_name: "<<parameters.ident>>:${CIRCLE_SHA1:0:10}"
- run: docker tag "<<parameters.ident>>:${CIRCLE_SHA1:0:10}" "thekevjames/<<parameters.ident>>:<<parameters.tag>>"
- run: docker tag "<<parameters.ident>>:${CIRCLE_SHA1:0:10}" "thekevjames/<<parameters.ident>>:latest"
- run: docker tag "<<parameters.ident>>:${CIRCLE_SHA1:0:10}" "quay.io/thekevjames/<<parameters.ident>>:<<parameters.tag>>"
- run: docker tag "<<parameters.ident>>:${CIRCLE_SHA1:0:10}" "quay.io/thekevjames/<<parameters.ident>>:latest"
- run: docker push "thekevjames/<<parameters.ident>>:<<parameters.tag>>"
- run: docker push "thekevjames/<<parameters.ident>>:latest"
- run: docker push "quay.io/thekevjames/<<parameters.ident>>:<<parameters.tag>>"
- run: docker push "quay.io/thekevjames/<<parameters.ident>>:latest"
# See thekevjames/tools
docker-readme-build:
docker:
- image: pandoc/core:3.1.1
steps:
- run: apk add --no-cache --no-progress ca-certificates openssl
- run: mkdir /meta
- checkout
- run: pandoc -o/meta/README.md README.rst
- persist_to_workspace:
root: /meta
paths:
- README.md
# See thekevjames/tools
# TODO: this should be doable with curl or python...
docker-readme-push:
docker:
- image: node:21.7.3-alpine
parameters:
ident:
type: string
default: "coveralls"
steps:
- run: apk add --no-cache --no-progress ca-certificates openssl
- checkout
- run: npm install docker-hub-api
- attach_workspace:
at: /meta
- run: node ./docker-update-readme.js thekevjames <<parameters.ident>> /meta/README.md
toxpy:
executor: <<parameters.executor>>
parameters:
executor:
type: executor
steps:
- run: apk add --no-cache git
- checkout
- run: pip install --upgrade tox
- run: tox run -f "${CIRCLE_JOB//test-}"
- run: tox run -e upload
toxpypy:
executor: <<parameters.executor>>
parameters:
executor:
type: executor
steps:
- run: apt-get update -qy
- run: apt-get install -qy --no-install-recommends git
- checkout
- run: pip install --upgrade tox
- run: tox run -f pypy3
- run: tox run -e upload
workflows:
docker:
when:
equal: [ master, << pipeline.git.branch >> ]
jobs:
- docker-publish:
tag: "${CIRCLE_SHA1:0:10}"
post-steps:
- run: |
export COVERALLS_VERSION=$(awk -F'=' '/ARG COVERALLS_VERSION=/ {print substr($2, 1, length($2))}' Dockerfile)
echo "${COVERALLS_VERSION}" >/tmp/custom-tag
- custom-tag
- docker-readme-build:
requires:
- docker-publish
- docker-readme-push:
requires:
- docker-readme-build
test:
jobs:
- linter/pre-commit:
executor: py38
pre-steps:
- run: apk add --no-cache git
- toxpy:
name: test-<<matrix.executor>>
matrix:
parameters:
executor: [py38, py39, py310, py311, py312]
- toxpypy:
name: test-<<matrix.executor>>
matrix:
parameters:
executor: [pypy737, pypy7311, pypy73]