main.yml 10.0 KB
Newer Older
1 2 3 4 5 6
name: CI

on: [push, pull_request]

env:
  GH_REPO_NAME: ${{ github.event.repository.name }}
7
  DOXYFILE: ${{ github.workspace }}/.doc_autogeneration.doxygen
8 9 10 11 12 13 14 15 16 17 18
  GH_REPO_REF: ${{ github.repositoryUrl }}

jobs:
  build:
    name: ${{ matrix.env.NAME }}
    runs-on: ${{ matrix.os }}
    env: ${{ matrix.env }}
    strategy:
      fail-fast: false
      matrix:
        include:
19 20 21
          # Ubuntu
          # Ubuntu 20.04 - Default - CMake - CUDA
          - os: ubuntu-20.04
22 23
            os_name: linux
            env:
24 25
              NAME: U20-default-cmake-cuda
              WITH_CUDNN: false
26
              CI_OS_NAME: linux
27 28 29 30 31 32
          # Ubuntu 18.04 - Default - CMake - CUDA
          - os: ubuntu-18.04
            os_name: linux
            env:
              NAME: U18-default-cmake-cuda
              WITH_CUDNN: false
33
              CI_OS_NAME: linux
34 35
          # Ubuntu 20.04 - Python - CMake - CUDA
          - os: ubuntu-20.04
36 37
            os_name: linux
            env:
38 39
              NAME: U20-python-cmake-cuda
              WITH_CUDNN: false
40
              WITH_PYTHON: true
41 42 43
              CI_OS_NAME: linux
              CI_BUILD_NUMBER: ${{ github.run_number }}
              CI_COMMIT: ${{ github.sha }}
44
              PYTHON3_VERSION: python3.8
45
            DOCS: true
46 47 48 49 50 51 52
          # Ubuntu 18.04 - Python - CMake - CUDA
          - os: ubuntu-18.04
            os_name: linux
            env:
              NAME: U18-python-cmake-cuda
              WITH_CUDNN: false
              WITH_PYTHON: true
53
              CI_OS_NAME: linux
54 55 56 57 58 59 60 61
          # Ubuntu 20.04 - Python - CMake - CPU
          - os: ubuntu-20.04
            os_name: linux
            env:
              NAME: U20-python-cmake-cpu
              WITH_PYTHON: true
              WITH_CUDA: false
              WITH_CUDNN: false
62
              CI_OS_NAME: linux
63 64 65 66 67 68 69 70 71
              PYTHON3_VERSION: python3.8
          # Ubuntu 18.04 - Python - CMake - CPU
          - os: ubuntu-18.04
            os_name: linux
            env:
              NAME: U18-python-cmake-cpu
              WITH_PYTHON: true
              WITH_CUDA: false
              WITH_CUDNN: false
72
              CI_OS_NAME: linux
73 74 75 76 77 78 79 80
          # Ubuntu 16.04 - Python - CMake - CPU
          - os: ubuntu-16.04
            os_name: linux
            env:
              NAME: U16-python-cmake-cpu
              WITH_PYTHON: true
              WITH_CUDA: false
              WITH_CUDNN: false
81
              CI_OS_NAME: linux
82 83 84 85 86 87 88 89 90 91
          # TO-DO (not passing)
          # # Ubuntu 20.04 - Python - CMake - OpenCL
          # - os: ubuntu-20.04
          #   os_name: linux
          #   env:
          #     NAME: U20-python-cmake-opencl
          #     WITH_PYTHON: true
          #     WITH_CUDA: false
          #     WITH_CUDNN: false
          #     WITH_OPEN_CL: true
92
          #     CI_OS_NAME: linux
93 94 95 96 97 98 99 100 101 102
          #     PYTHON3_VERSION: python3.8
          # Ubuntu 18.04 - Python - CMake - OpenCL
          - os: ubuntu-18.04
            os_name: linux
            env:
              NAME: U18-python-cmake-opencl
              WITH_PYTHON: true
              WITH_CUDA: false
              WITH_CUDNN: false
              WITH_OPEN_CL: true
103
              CI_OS_NAME: linux
104 105 106 107 108 109 110 111 112
          # Ubuntu 16.04 - Python - CMake - OpenCL
          - os: ubuntu-16.04
            os_name: linux
            env:
              NAME: U16-python-cmake-opencl
              WITH_PYTHON: true
              WITH_CUDA: false
              WITH_CUDNN: false
              WITH_OPEN_CL: true
113
              CI_OS_NAME: linux
114 115 116 117 118 119 120 121 122
          # Ubuntu 20.04 - Python - CMake - CPU - Debug
          - os: ubuntu-20.04
            os_name: linux
            env:
              NAME: U20-python-cmake-cpu-debug
              WITH_PYTHON: true
              WITH_CUDA: false
              WITH_CUDNN: false
              WITH_DEBUG: true
123
              CI_OS_NAME: linux
124 125 126 127 128 129 130 131 132 133
              PYTHON3_VERSION: python3.8
          # Ubuntu 18.04 - Python - CMake - CPU - Debug
          - os: ubuntu-18.04
            os_name: linux
            env:
              NAME: U18-python-cmake-cpu-debug
              WITH_PYTHON: true
              WITH_CUDA: false
              WITH_CUDNN: false
              WITH_DEBUG: true
134
              CI_OS_NAME: linux
135 136 137 138 139 140 141 142 143
          # Ubuntu 16.04 - Python - CMake - CPU - Debug
          - os: ubuntu-16.04
            os_name: linux
            env:
              NAME: U16-python-cmake-cpu-debug
              WITH_PYTHON: true
              WITH_CUDA: false
              WITH_CUDNN: false
              WITH_DEBUG: true
144
              CI_OS_NAME: linux
145 146
          # Ubuntu 20.04 - Python - CMake - CPU - Unity
          - os: ubuntu-20.04
147 148
            os_name: linux
            env:
149
              NAME: U20-python-cmake-cpu-unity
150 151 152 153
              WITH_PYTHON: true
              WITH_UNITY: true
              WITH_CUDA: false
              WITH_CUDNN: false
154
              CI_OS_NAME: linux
155 156 157 158 159 160 161 162
              PYTHON3_VERSION: python3.8
          # Ubuntu 20.04 - Default - CMake - CPU
          - os: ubuntu-20.04
            os_name: linux
            env:
              NAME: U20-default-cmake-cpu
              WITH_CUDA: false
              WITH_CUDNN: false
163
              CI_OS_NAME: linux
164 165 166 167 168 169 170 171 172 173

          # Mac OSX
          # Mac OSX - Python - CMake - CPU
          - os: macos-10.15
            os_name: osx
            env:
              NAME: OSX-python-cmake-cpu
              WITH_CUDA: false
              WITH_CUDNN: false
              WITH_PYTHON: true
174
              CI_OS_NAME: osx
175 176 177 178 179 180 181 182
          # Mac OSX - Python - CMake - OpenCL
          - os: macos-10.15
            os_name: osx
            env:
              NAME: OSX-default-cmake-opencl
              WITH_CUDA: false
              WITH_CUDNN: false
              WITH_OPEN_CL: true
183
              CI_OS_NAME: osx
184 185 186 187 188 189 190 191 192
          # Mac OSX - Python - CMake - CPU - Debug
          - os: macos-10.15
            os_name: osx
            env:
              NAME: OSX-python-cmake-cpu-debug
              WITH_CUDA: false
              WITH_CUDNN: false
              WITH_PYTHON: true
              WITH_DEBUG: true
193
              CI_OS_NAME: osx
194 195 196 197 198 199 200 201 202
          # Mac OSX - Python - CMake - CPU - Unity
          - os: macos-10.15
            os_name: osx
            env:
              NAME: OSX-python-cmake-cpu-unity
              WITH_CUDA: false
              WITH_CUDNN: false
              WITH_PYTHON: true
              WITH_UNITY: true
203
              CI_OS_NAME: osx
204 205 206 207 208 209 210
          # Mac OSX - Default - CMake - CPU
          - os: macos-10.15
            os_name: osx
            env:
              NAME: OSX-default-cmake-cpu
              WITH_CUDA: false
              WITH_CUDNN: false
211
              CI_OS_NAME: osx
212

213 214 215 216 217
          # TO-DO (not passing)
          # Note: CUDA jobs fail in U16 because of an issue with GCC 5.5 (https://github.com/NVIDIA/apex/issues/529). GH Actions doesn't support
          # GCC 5.4 and CUDA does not support newer than GCC 5.X. Thus, cuDNN (sh file only for Ubuntu 16) is no longer tested.
          # # Ubuntu 16.04
          # # Ubuntu 16.04 - Default - CMake - CUDA
218 219 220
          # - os: ubuntu-16.04
          #   os_name: linux
          #   env:
221
          #     NAME: U16-default-cmake-cuda8
222
          #     CI_OS_NAME: linux
223

224 225
          # # Deprecated (not working for the above issue between CUDA and the Ubuntu16 from GitHub Actions) 
          # # Ubuntu 16.04 - Default - Make - CUDA
226 227 228
          # - os: ubuntu-16.04
          #   os_name: linux
          #   env:
229
          #     NAME: U16-default-make-cuda
230
          #     WITH_CUDNN: false
231
          #     WITH_CMAKE: false
232
          #     CI_OS_NAME: linux
233 234 235 236 237 238 239 240 241 242 243

    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 0
        submodules: recursive
    - uses: actions/setup-python@v2
      with:
        python-version: 2.x
      if: ${{ matrix.env.WITH_PYTHON }}
    - name: Install (Linux)
244
      run: scripts/CI/install_deps_ubuntu.sh
245 246
      if: ${{ matrix.os_name == 'linux' }}
    - name: Install (Mac OS)
247
      run: scripts/CI/install_deps_osx.sh
248 249 250
      if: ${{ matrix.os_name == 'osx' }}

    - name: Configure
251
      run: scripts/CI/configure.sh
252
    - name: Make
253
      run: scripts/CI/run_make.sh
254
    - name: Tests
255
      run: scripts/CI/run_tests.sh
256 257 258

    - name: Docs APT packages
      run: |
259 260
        # The Doxygen apt-get version for Ubuntu 20 is 1.8.17, which has some bugs fixed in 1.9.1
        # run: sudo apt-get -yq install doxygen doxygen-doc doxygen-latex doxygen-gui graphviz
261 262 263 264 265 266
        git clone https://github.com/doxygen/doxygen.git && cd doxygen && git checkout Release_1_9_1
        mkdir build && cd build
        cmake -G "Unix Makefiles" ..
        make -j`nproc`
        sudo make install
      if: ${{ matrix.DOCS }}
267 268 269 270 271
    - name: Generate docs
      run: |
        cd ${{ github.workspace }}
        echo 'Generating Doxygen code documentation...'
        doxygen $DOXYFILE 2>&1 | tee doxygen.log
272 273 274
        echo 'Creating .nojekyll and copying log...'
        echo "" > doxygen/html/.nojekyll
        cp doxygen.log doxygen/html/doxygen.log
275 276
        # Required so Doxygen links/finds the license file
        cp LICENSE doxygen/html/LICENSE
277 278 279 280 281
        # Required in order to link .github/media/ images with doc without modifying doc links. Remove if using `publish_dir: doxygen/html/`
        mkdir -p doxygen_final/web/html/ && mv doxygen/html doxygen_final/web/html/doc
        mkdir -p doxygen_final/web/.github/media/ && cp -rf .github/media/ doxygen_final/web/.github/
        mkdir -p doxygen_final/web/html/.github/media/ && cp -rf .github/media/ doxygen_final/web/html/.github/
        mkdir -p doxygen_final/web/html/doc/.github/media/ && cp -rf .github/media/ doxygen_final/web/html/doc/.github/
282 283 284 285 286
      if: ${{ matrix.DOCS }}
    - name: Deploy Docs
      uses: peaceiris/actions-gh-pages@v3
      with:
        github_token: ${{ secrets.GITHUB_TOKEN }}
287 288
        publish_dir: doxygen_final/
        # publish_dir: doxygen/html/ # Original one, it would turn [...].github.io/openpose/web/html/doc/ into [...].github.io/openpose/, but images would not work
289 290 291 292
        destination_dir: .
        enable_jekyll: false
        force_orphan: true
      if: ${{ matrix.DOCS && github.event_name == 'push' && github.ref == 'refs/heads/master' }}