|
1 | 1 | version: 2.1 |
2 | 2 |
|
3 | 3 | 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 |
5 | 6 |
|
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 |
48 | 10 |
|
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 |
93 | 28 |
|
94 | 29 | 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 >> |
97 | 88 | 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 |
0 commit comments