-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
config.yml
108 lines (101 loc) · 3.62 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
version: 2.1
jobs:
# The following job is to run any image comparison test, and runs on any branch
# or in any pull request. It will generate a summary page for each tox environment
# being run, and giles will report the URL of the summary page back to the pull
# request (alternatively you can find the summary page in the artifacts in the
# CircleCI UI).
figure:
parameters:
jobname:
type: string
docker:
- image: circleci/python:3.9
environment:
TOXENV=<< parameters.jobname >>
steps:
- checkout
- run:
name: Install dependencies
command: |
sudo apt update
sudo apt install texlive texlive-latex-extra texlive-fonts-recommended dvipng cm-super
pip install pip "tox<4"
- run:
name: Run tests
command: tox -v
- run:
name: Upload coverage results to codecov
command: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov -t ${CODECOV_TOKEN} -f coverage.xml
- store_artifacts:
path: results
- run:
name: "Image comparison page is available at: "
command: echo "${CIRCLE_BUILD_URL}/artifacts/${CIRCLE_NODE_INDEX}/results/fig_comparison.html"
# The following job runs only on main - and its main purpose is to update the reference
# images in the astropy-figure-tests repository. This job needs a deploy key. To produce
# this, go to the astropy-figure-tests repository settings and go to SSH keys, then add
# your public SSH key.
deploy-reference-images:
parameters:
jobname:
type: string
docker:
- image: circleci/python:3.9
environment:
TOXENV: << parameters.jobname >>
GIT_SSH_COMMAND: ssh -i ~/.ssh/id_rsa_bfaaefe38d95110b75c79252bafbe0fc
steps:
- checkout
- run:
name: Install dependencies
command: |
sudo apt update
sudo apt install texlive texlive-latex-extra texlive-fonts-recommended dvipng cm-super
pip install pip "tox<4"
- run: ssh-add -D
- add_ssh_keys:
fingerprints: "bf:aa:ef:e3:8d:95:11:0b:75:c7:92:52:ba:fb:e0:fc"
- run: ssh-keyscan github.com >> ~/.ssh/known_hosts
- run: git config --global user.email "astropy@circleci" && git config --global user.name "Astropy Circle CI"
- run: git clone git@github.com:astropy/astropy-figure-tests.git --depth 1 -b astropy-${CIRCLE_BRANCH} ~/astropy-figure-tests/
- run:
name: Generate reference images
command: tox -v -- --mpl-generate-path=/home/circleci/astropy-figure-tests/figures/$TOXENV
- run: |
cd ~/astropy-figure-tests/
git pull
git status
git add .
git commit -m "Update reference figures from ${CIRCLE_BRANCH}" || echo "No changes to reference images to deploy"
git push
workflows:
version: 2
figure-tests:
jobs:
- figure:
name: << matrix.jobname >>
matrix:
parameters:
jobname:
- "py39-test-image-mpl311-cov"
- "py39-test-image-mpldev-cov"
- deploy-reference-images:
name: baseline-<< matrix.jobname >>
matrix:
parameters:
jobname:
- "py39-test-image-mpl311-cov"
- "py39-test-image-mpldev-cov"
requires:
- << matrix.jobname >>
filters:
branches:
only:
- main
notify:
webhooks:
- url: https://giles.cadair.dev/circleci