summaryrefslogtreecommitdiff
path: root/.circleci/config.yml
blob: c3d4352e82a0a333575c4a00e961110b060c0600 (plain)
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
# Python CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-python/ for more details
#
version: 2
jobs:
  build:
    docker:
      # CircleCI maintains a library of pre-built images
      # documented at https://circleci.com/docs/2.0/circleci-images/
      - image: circleci/python:3.6.6

    working_directory: ~/repo

    steps:
      - checkout

      - run:
          name: install dependencies
          command: |
            python3 -m venv venv
            ln -s $(which python3) venv/bin/python3.6
            . venv/bin/activate
            pip install cython sphinx==2.3.1 matplotlib ipython
            sudo apt-get update
            sudo apt-get install -y graphviz texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra texlive-generic-extra latexmk texlive-xetex

      - run:
          name: build numpy
          command: |
            . venv/bin/activate
            pip install --upgrade pip setuptools
            pip install cython
            pip install .
            pip install scipy
            pip install pandas

      - run:
          name: create release notes
          command: |
            . venv/bin/activate
            pip install git+https://github.com/hawkowl/towncrier.git@master
            VERSION=$(python -c "import setup; print(setup.VERSION)")
            towncrier --version $VERSION --yes
            ./tools/ci/test_all_newsfragments_used.py

      - run:
          name: run doctests on documentation
          command: |
            . venv/bin/activate
            (cd doc ; git submodule update --init)
            python tools/refguide_check.py --rst

      - run:
          name: build devdocs
          command: |
            . venv/bin/activate
            cd doc
            SPHINXOPTS=-q make -e html

      - run:
          name: build neps
          command: |
            . venv/bin/activate
            cd doc/neps
            SPHINXOPTS=-q make -e html

      - store_artifacts:
          path: doc/build/html/


     #  - store_artifacts:
     #      path: doc/neps/_build/html/
     #      destination: neps

      - add_ssh_keys:
          fingerprints:
            - "9f:8c:e5:3f:53:40:0b:ee:c9:c3:0f:fd:0f:3c:cc:55"

      -  run:
          name: deploy devdocs
          command: |
            if [ "${CIRCLE_BRANCH}" == "master" ]; then
              touch doc/build/html/.nojekyll

              ./tools/ci/push_docs_to_repo.py doc/build/html \
                  git@github.com:numpy/devdocs.git \
                  --committer "numpy-circleci-bot" \
                  --email "numpy-circleci-bot@nomail" \
                  --message "Docs build of $CIRCLE_SHA1" \
                  --force
            else
              echo "Not on the master branch; skipping deployment"
            fi

      - add_ssh_keys:
          fingerprints:
            - "11:fb:19:69:80:3a:6d:37:9c:d1:ac:20:17:cd:c8:17"

      - run:
          name: select SSH key for neps repo
          command: |
            cat <<\EOF > ~/.ssh/config
            Host github.com
              IdentitiesOnly yes
              IdentityFile /home/circleci/.ssh/id_rsa_11fb1969803a6d379cd1ac2017cdc817
            EOF

      -  run:
          name: deploy neps
          command: |
            if [ "${CIRCLE_BRANCH}" == "master" ]; then
              touch doc/neps/_build/html/.nojekyll

              ./tools/ci/push_docs_to_repo.py doc/neps/_build/html \
                  git@github.com:numpy/neps.git \
                  --committer "numpy-circleci-bot" \
                  --email "numpy-circleci-bot@nomail" \
                  --message "Docs build of $CIRCLE_SHA1" \
                  --force
            else
              echo "Not on the master branch; skipping deployment"
            fi