-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathconfig.yml
136 lines (127 loc) · 4.05 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
####################
# CircleCI configuration reference:
# https://circleci.com/docs/2.0/configuration-reference
####################
# CircleCI built-in environment variables:
# https://circleci.com/docs/2.0/env-vars/#built-in-environment-variables
####################
test_settings: &test_settings
steps:
- checkout
- run: &run_tox_environment_matching_circleci_job_name
name: Run tox job
command: |
pip install tox
tox -e $CIRCLE_JOB
- run:
name: Submit code coverage data
command: |
curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import
curl -Os https://uploader.codecov.io/latest/linux/codecov
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
shasum -a 256 -c codecov.SHA256SUM
chmod +x codecov
./codecov -F "$(basename $PWD | sed s/[^a-z]/_/g)"
####################
# Jobs: see https://circleci.com/docs/2.0/jobs-steps/
####################
version: 2
jobs:
py310:
<<: *test_settings
docker:
- image: cimg/python:3.10
lint:
docker:
- image: cimg/python:3.10
steps:
- checkout
- run:
name: Run linting
command: |
pip install -r requirements-dev.txt
ruff check src/ tests/
# Runs when the repository is tagged for release; see the workflows section
# below for trigger logic.
deploy:
docker:
- image: cimg/python:3.10
steps:
- checkout
- run:
name: Install deployment tools
command: |
pip install -r requirements-dev.txt
- run:
name: Create the distribution files
command: |
python3 -m build --sdist
- run:
name: Upload to PyPI
command: |
# Relies on the TWINE_USERNAME and TWINE_PASSWORD environment variables configured at:
# https://circleci.com/gh/mozilla/mozanalysis/edit#env-vars
# For more on twine, see:
# https://twine.readthedocs.io/en/latest/
twine upload dist/*
docs: &docs_settings
docker:
- image: cimg/python:3.10
steps:
- checkout
- run:
<<: *run_tox_environment_matching_circleci_job_name
- persist_to_workspace:
root: docs/_build
paths: html
docs-deploy:
docker:
- image: node:22
steps:
- checkout
- attach_workspace:
at: docs/_build
- run:
name: Disable jekyll builds
command: touch docs/_build/html/.nojekyll
# Needed for write access to the GitHub repository;
# see https://circleci.com/docs/2.0/gh-bb-integration/#deployment-keys-and-user-keys
- add_ssh_keys:
fingerprints: "1d:46:d1:24:12:32:22:1c:2a:6e:c0:82:72:ab:00:31"
# The gh-pages npm package looks to be the most widely used utility for
# pushing a directory to a git branch;
# see https://www.npmjs.com/package/gh-pages
- run:
name: Deploy docs to gh-pages branch
command: |
git config user.email "[email protected]"
git config user.name "CircleCI docs-deploy job"
npm install -g --silent gh-pages@^2.0.0
gh-pages --dotfiles --message "[skip ci] Updates" --dist docs/_build/html
####################
# Workflows: see https://circleci.com/docs/2.0/workflows/
####################
workflows:
version: 2
build:
jobs:
- py310
- lint
- docs
- docs-deploy:
requires:
- docs
filters:
branches:
only: main
tagged-deploy:
jobs:
- deploy:
filters:
tags:
only: /[0-9]{4}.[0-9]{1,2}.[0-9]+/ # Calver: YYYY.M.MINOR
branches:
# Ignore all branches; this workflow should only run for tags.
ignore: /.*/