ci-cpu-linux.yml 1.9 KB
Newer Older
1
name: cpu-linux-build-and-test
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

on:
  push:
    paths-ignore:
      - '**.md'
      - 'images/**'
  pull_request:
    paths-ignore:
      - '**.md'
      - 'images/**'

jobs:
  build:
    strategy:
      matrix:
        config: [ '', '-DPBRT_DBG_LOGGING=True', '-DPBRT_FLOAT_AS_DOUBLE=True' ]
        compilers:
        - {
            cc: "gcc-9",
            cxx: "g++-9",
          }
        - {
            cc: "gcc-10",
            cxx: "g++-10",
          }
        - {
            cc: "clang-10",
            cxx: "clang++-10",
          }
        - {
            cc: "clang-11",
            cxx: "clang++-11",
          }
35 36 37 38 39
# WAR github actions flakiness
#        - {
#            cc: "clang-12",
#            cxx: "clang++-12",
#          }
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63

      fail-fast: false

    runs-on: ubuntu-20.04
    name: Build and test ${{ matrix.compilers.cxx }} - ${{ matrix.config }}

    steps:
    - name: Checkout pbrt
      uses: actions/checkout@v2
      with:
        submodules: true

    - name: Checkout rgb2spectrum tables
      uses: actions/checkout@v2
      with:
        repository: mmp/rgb2spectrum
        path: build
      
    - name: Get cmake
      uses: lukka/get-cmake@latest

    - name: Install OpenEXR
      run: sudo apt-get -y install libopenexr-dev

M
Matt Pharr 已提交
64 65 66
    - name: Install OpenGL
      run: sudo apt-get install -y --no-install-recommends libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxext-dev libxfixes-dev libgl1-mesa-dev

67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
    - name: Install compilers
      run: sudo apt-get -y install ${{ matrix.compilers.cc }} ${{ matrix.compilers.cxx }}

    - name: Configure
      run: |
        cd build
        env CC=${{ matrix.compilers.cc }} CXX=${{ matrix.compilers.cxx }} cmake .. -DPBRT_USE_PREGENERATED_RGB_TO_SPECTRUM_TABLES=True ${{ matrix.config }}
      
    - name: Build
      run: cmake --build build --parallel --config Release
      
    - name: Test
      if: ${{ matrix.config == '' }}
      run: ./pbrt_test
      working-directory: build