Skip to content

Commit c81c6b5

Browse files
authored
Circleci project setup (#28)
* add circleci project setup * fix docs * update appveyor config * remove RTD config * add environment file for ci * remove redundant files * update link to documentation * install psutil for tests * update changelog with circleci changes
1 parent 8ed51e4 commit c81c6b5

17 files changed

+261
-383
lines changed
Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,43 @@
11
environment:
22

33
PYTHON_ARCH: "64"
4-
PYTHON: "C:\\Miniconda36-x64"
4+
PYTHON: "C:\\Miniconda38-x64"
55

66
matrix:
77
- PYTHON_VERSION: "3.8"
8-
QT_VERSION: "5"
9-
BUILD_STR_END: cf
10-
- PYTHON_VERSION: "3.7"
11-
QT_VERSION: "5"
12-
- PYTHON_VERSION: "3.7"
13-
QT_VERSION: "5"
14-
BUILD_STR_END: cf
158

169
install:
1710
# windows config (for installation)
1811
- cmd: "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
1912
- cmd: setlocal
20-
- cmd: set CONDA_REPO_TOKEN=
13+
- cmd: set ANACONDA_API_TOKEN=
2114
# conda config
2215
- conda config --set always_yes yes --set changeps1 no
2316
- conda update -q conda
2417
- conda install conda-build anaconda-client
25-
- IF NOT DEFINED BUILD_STR_END (conda config --add channels chilipp/label/conda-forge) ELSE (conda config --add channels conda-forge)
18+
- pip install -i https://pypi.anaconda.org/psyplot/simple --no-deps psyplot-ci-orb
19+
- conda config --add channels conda-forge
2620
- conda config --add channels psyplot
2721
- conda info -a
2822
- conda list
2923
# windows config
3024
- cmd: endlocal
3125
- cmd: 'SET PYTHONWARNINGS=ignore:mode:DeprecationWarning:docutils.io:245'
3226
- cmd: "IF NOT DEFINED APPVEYOR_REPO_TAG_NAME (SET GIT_BRANCH=%APPVEYOR_REPO_BRANCH%)"
33-
- cmd: "IF NOT DEFINED APPVEYOR_REPO_TAG_NAME (conda config --add channels psyplot/label/master)"
3427
- cmd: "IF NOT DEFINED APPVEYOR_REPO_TAG_NAME (conda config --add channels psyplot/label/%APPVEYOR_REPO_BRANCH%)"
35-
- cmd: python ci\\setup_append.py ci\\conda-recipe pyqt=%QT_VERSION%
3628

3729
build: off
3830

3931
test_script:
4032
- cmd: setlocal
41-
- cmd: set CONDA_REPO_TOKEN=
33+
- cmd: set ANACONDA_API_TOKEN=
4234
- cmd: conda build ci/conda-recipe --python %PYTHON_VERSION%
4335
- cmd: endlocal
4436

4537
deploy_script:
46-
- cmd: "python ci\\deploy_anaconda.py"
38+
- cmd: "
39+
IF NOT DEFINED APPVEYOR_REPO_TAG_NAME (
40+
deploy-conda-recipe -l %APPVEYOR_REPO_BRANCH% -py %PYTHON_VERSION% ci/conda-recipe
41+
) ELSE (
42+
deploy-conda-recipe -py %PYTHON_VERSION% ci/conda-recipe
43+
)"

.circleci/config.yml

Lines changed: 105 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,113 @@
11
version: 2.1
22

33
orbs:
4-
win: circleci/windows@2.2.0
4+
psyplot: psyplot/psyplot-ci-orb@1.5.22
5+
mattermost-plugin-notify: nathanaelhoun/mattermost-plugin-notify@1.2.0
56

6-
commands:
7-
configure_conda:
8-
description: "Install conda on the sytem"
9-
steps:
10-
- run:
11-
name: Configure
12-
command: |
13-
which conda || source $HOME/miniconda3/bin/activate base
14-
conda config --set always_yes yes --set changeps1 no
15-
conda config --add channels conda-forge
16-
conda config --add channels psyplot
17-
conda update -q conda
18-
conda install conda-build anaconda-client conda-verify
19-
if [[ $CIRCLE_PULL_REQUEST != "" ]]; then
20-
conda config --add channels psyplot/label/master;
21-
elif [[ $CIRCLE_TAG == "" ]]; then
22-
conda config --add channels psyplot/label/master;
23-
conda config --add channels psyplot/label/${CIRCLE_BRANCH};
24-
fi
25-
- run:
26-
name: Environment info
27-
command: |
28-
which conda || source $HOME/miniconda3/bin/activate base
29-
conda info -a
30-
conda list
31-
- run:
32-
name: Setup append
33-
command: |
34-
which conda || source $HOME/miniconda3/bin/activate base
35-
python ci/setup_append.py ci/conda-recipe pyqt=5
36-
build_recipe:
37-
description: "Build the conda recipe"
38-
parameters:
39-
python_version:
40-
type: string
41-
default: "3.8"
42-
steps:
43-
- run:
44-
name: Build conda recipe
45-
command: |
46-
which conda || source $HOME/miniconda3/bin/activate base
47-
conda build ci/conda-recipe --python << parameters.python_version >>
7+
executors:
8+
default: psyplot/default
9+
macos: psyplot/macos
4810

49-
50-
jobs:
51-
build_windows:
52-
executor:
53-
name: win/default
54-
shell: bash.exe
55-
parameters:
56-
python_version:
57-
type: string
58-
default: "3.8"
59-
working_directory: ~/test
60-
steps:
61-
- checkout
62-
- configure_conda
63-
- run:
64-
name: Build recipe
65-
shell: cmd.exe
66-
command: conda activate & conda build ci/conda-recipe --python << parameters.python_version >>
67-
build_linux:
68-
parameters:
69-
python_version:
70-
type: string
71-
default: "3.8"
72-
working_directory: ~/test
73-
machine: true
74-
steps:
75-
- checkout
76-
- run:
77-
name: install apt requirements
78-
command: |
79-
sudo apt-get update
80-
sudo apt-get install libgl1-mesa-glx libegl1-mesa-dev
81-
- run:
82-
name: Install conda
83-
command: |
84-
echo ""
85-
echo "Installing a fresh version of Miniconda."
86-
MINICONDA_URL="https://repo.continuum.io/miniconda"
87-
MINICONDA_FILE="Miniconda3-latest-Linux-x86_64.sh"
88-
curl -L -O "${MINICONDA_URL}/${MINICONDA_FILE}"
89-
bash $MINICONDA_FILE -bp $HOME/miniconda3
90-
- configure_conda
91-
- build_recipe:
92-
python_version: << parameters.python_version >>
11+
parameters:
12+
unit-test-executor:
13+
description: Executor for the unit tests. Can be default or macos
14+
type: string
15+
default: default
16+
deploy-release:
17+
description: Deploy the comment as a new release to github and pypi
18+
type: boolean
19+
default: false
20+
run-tests:
21+
description: Run the test suite
22+
type: boolean
23+
default: true
24+
build_docs:
25+
description: Build the documentation
26+
type: boolean
27+
default: true
9328

9429
workflows:
95-
version: 2.1
96-
build_and_test:
30+
build-and-test:
31+
unless: << pipeline.parameters.deploy-release >>
32+
jobs:
33+
- psyplot/install-and-build:
34+
name: install
35+
exec_environment: << pipeline.parameters.unit-test-executor >>
36+
setup_env: true
37+
build_args: "--no-test"
38+
build_docs: << pipeline.parameters.build_docs >>
39+
- psyplot/test-parallel:
40+
name: run-tests
41+
parallelism: 2
42+
pytest_args: --cov=psyplot_gui
43+
run-job: << pipeline.parameters.run-tests >>
44+
requires:
45+
- install
46+
- psyplot/build-docs:
47+
name: test-docs
48+
run-job: << pipeline.parameters.build_docs >>
49+
builders: linkcheck
50+
requires:
51+
- install
52+
- mattermost-plugin-notify/approval-notification:
53+
name: notify-deploy
54+
context: mattermost
55+
message: >-
56+
Hello @all! A workflow on https://app.circleci.com/pipelines/github/psyplot/psyplot-gui is awaiting your approval.
57+
Please check the uploaded docs and builds prior to approval.
58+
requires:
59+
- run-tests
60+
- test-docs
61+
- hold-for-deploy:
62+
type: approval
63+
requires:
64+
- notify-deploy
65+
- psyplot/deploy-pkg:
66+
exec_environment: << pipeline.parameters.unit-test-executor >>
67+
context: anaconda
68+
requires:
69+
- hold-for-deploy
70+
- psyplot/deploy-docs:
71+
fingerprint: "fc:e3:0f:d0:c6:5a:6a:a5:0e:7c:d6:47:37:48:dd:67"
72+
run-job: << pipeline.parameters.build_docs >>
73+
requires:
74+
- hold-for-deploy
75+
filters:
76+
branches:
77+
only: master
78+
- psyplot/trigger-release-workflow:
79+
context: trigger-release
80+
filters:
81+
branches:
82+
only: master
83+
requires:
84+
- psyplot/deploy-pkg
85+
- psyplot/deploy-docs
86+
publish-release:
87+
when: << pipeline.parameters.deploy-release >>
9788
jobs:
98-
- build_linux
99-
- build_linux:
100-
python_version: "3.7"
101-
# - build_windows
102-
# - build_windows:
103-
# python_version: "3.7"
89+
- psyplot/create-tag:
90+
ssh-fingerprints: "fc:e3:0f:d0:c6:5a:6a:a5:0e:7c:d6:47:37:48:dd:67"
91+
context: psyplot-admin
92+
user-name: psyplot-admin
93+
publish-release: true
94+
publish-version-tag: true
95+
- mattermost-plugin-notify/approval-notification:
96+
name: notify-release
97+
context: mattermost
98+
message: >-
99+
Hello @all! A new release has been created at https://github.com/psyplot/psyplot-gui/releases.
100+
Please review it carefully, publish it and approve the upload to pypi.
101+
requires:
102+
- psyplot/create-tag
103+
- hold-for-pypi:
104+
type: approval
105+
requires:
106+
- notify-release
107+
- psyplot/deploy-pypi:
108+
context: pypi
109+
requires:
110+
- hold-for-pypi
111+
filters:
112+
branches:
113+
only: master

.travis.yml

Lines changed: 0 additions & 113 deletions
This file was deleted.

0 commit comments

Comments
 (0)