summaryrefslogtreecommitdiff
path: root/.circleci/config.yml
blob: dbb3e78279c71b51557b39a2ec8bad9d5188c4c3 (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
# See: https://circleci.com/docs/2.0/language-python/

version: 2.1
jobs:
  documentation:
    docker:
      - image: cimg/python:3.10

    steps:
      - checkout

      - run:
          name: Update apt-get
          command: |
            sudo apt-get update

      - run:
          name: Install Graphviz
          command: |
            sudo apt-get install graphviz libgraphviz-dev

      - run:
          name: Install pysal dependencies
          command: |
            sudo apt-get install libspatialindex-dev

      - restore_cache:
          keys:
            - pip-cache-v1

      - run:
          name: Install Python dependencies
          command: |
            python3 -m venv venv
            source venv/bin/activate
            pip install --upgrade pip wheel setuptools
            pip install -r requirements/default.txt -r requirements/test.txt
            pip install -r requirements/extra.txt
            pip install -r requirements/example.txt
            pip install -r requirements/doc.txt
            pip list

      - save_cache:
          key: pip-cache-v1
          paths:
            - ~/.cache/pip

      - run:
          name: Install
          command: |
            source venv/bin/activate
            pip install -e .

      - run:
          name: Build docs
          command: |
            # NOTE: bad interaction w/ blas multithreading on circleci
            export OMP_NUM_THREADS=1
            source venv/bin/activate
            make -C doc/ html

      - store_artifacts:
          path: doc/build/html

  image:
    docker:
      - image: cimg/python:3.10

    steps:
      - checkout

      - run:
          name: Install Python dependencies
          command: |
            python -m venv venv
            source venv/bin/activate
            pip install --upgrade pip wheel setuptools
            pip install -r requirements/default.txt -r requirements/test.txt
            pip install pytest-mpl  # NOTE: specified here to avoid confusing conda
            pip list

      - run:
          name: Install
          command: |
            source venv/bin/activate
            pip install -e .

      - run:
          name: Test NetworkX drawing
          command: |
            source venv/bin/activate
            pytest --mpl --mpl-generate-summary=html --mpl-results-path=results --pyargs networkx.drawing

      - store_artifacts:
          path: results

workflows:
  documentation_and_image_comparison:
    jobs:
      - documentation
      - image