1name: GitHub Actions 2 3on: 4 push: 5 pull_request: 6 7jobs: 8 build: 9 strategy: 10 matrix: 11 include: 12 - name: ubuntu-latest-clang-autotools 13 os: ubuntu-latest 14 cc: clang 15 cxx: clang++ 16 build-system: autotools 17 configure-opts: '' 18 19 - name: ubuntu-latest-gcc-cmake 20 os: ubuntu-latest 21 cc: gcc 22 cxx: g++ 23 build-system: cmake 24 configure-opts: '' 25 26 - name: ubuntu-latest-clang-cmake 27 os: ubuntu-latest 28 cc: clang 29 cxx: clang++ 30 build-system: cmake 31 configure-opts: '' 32 33 - name: macos-latest-clang-autotools 34 os: macos-latest 35 cc: clang 36 cxx: clang++ 37 build-system: autotools 38 configure-opts: '' 39 40 - name: macos-latest-clang-cmake 41 os: macos-latest 42 cc: clang 43 cxx: clang++ 44 build-system: cmake 45 configure-opts: '' 46 47 - name: windows-latest-cmake 48 os: windows-latest 49 build-system: cmake 50 configure-opts: '' 51 52 - name: windows-latest-cmake-shared 53 os: windows-latest 54 build-system: cmake 55 configure-opts: '-DBUILD_SHARED_LIBS=ON' 56 57 runs-on: ${{ matrix.os }} 58 59 steps: 60 - uses: actions/checkout@v3 61 62 - uses: actions/checkout@v3 63 if: startsWith(matrix.build-system,'cmake') 64 with: 65 repository: xiph/ogg 66 path: ./ogg 67 68 - name: Install MacOS dependencies 69 if: startsWith(matrix.os,'macos') && !startsWith(matrix.build-system,'cmake') 70 run: | 71 brew update 72 brew install automake pkg-config libogg 73 74 - name: Install Linux dependencies 75 if: startsWith(matrix.os,'ubuntu') 76 run: | 77 sudo apt-get update 78 sudo apt-get install -y libtool-bin libogg-dev 79 80 - name: Install Windows dependencies 81 if: startsWith(matrix.os,'windows') 82 run: | 83 choco install busybox 84 85 - name: Build with Autotools 86 if: startsWith(matrix.build-system,'autotools') 87 env: 88 CC: ${{ matrix.cc }} 89 CXX: ${{ matrix.cxx }} 90 run: | 91 ./autogen.sh 92 ./configure ${{ matrix.configure-opts }} 93 make 94 make check 95 96 - name: Prepare CMake build directory 97 if: startsWith(matrix.build-system,'cmake') 98 env: 99 CC: ${{ matrix.cc }} 100 CXX: ${{ matrix.cxx }} 101 run: mkdir cmake-build 102 103 - name: CMake generator 104 if: startsWith(matrix.build-system,'cmake') 105 env: 106 CC: ${{ matrix.cc }} 107 CXX: ${{ matrix.cxx }} 108 working-directory: cmake-build 109 run: cmake .. -DCMAKE_BUILD_TYPE=Release -DINSTALL_MANPAGES=OFF -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON ${{ matrix.configure-opts }} -DCMAKE_FIND_FRAMEWORK=NEVER 110 111 - name: CMake build 112 if: startsWith(matrix.build-system,'cmake') 113 env: 114 CC: ${{ matrix.cc }} 115 CXX: ${{ matrix.cxx }} 116 working-directory: cmake-build 117 run: cmake --build . --config Release 118 119 - name: CMake test 120 if: startsWith(matrix.build-system,'cmake') 121 env: 122 CC: ${{ matrix.cc }} 123 CXX: ${{ matrix.cxx }} 124 working-directory: cmake-build 125 run: ctest -V -C Release 126 127 - name: Upload logs on failure 128 uses: actions/upload-artifact@v2 129 if: failure() 130 with: 131 name: flac-${{ github.sha }}-${{ github.run_id }}-logs 132 path: | 133 ./**/*.log 134 ./**/out*.meta 135