addressing build warnings on windows #1030
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Linux build | |
| on: | |
| pull_request: | |
| branches: | |
| - "*" | |
| push: | |
| branches: | |
| - "*" | |
| paths: | |
| # This action only runs on push when files affecting the build change | |
| - "**.cpp" | |
| - "**.h" | |
| - "**.glsl" | |
| - "**.cmake" | |
| - "**Lists.txt" | |
| - "**-linux.yml" | |
| workflow_dispatch: | |
| env: | |
| CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules | |
| jobs: | |
| build: | |
| name: ${{ matrix.config.name }} (${{ matrix.buildtype }}) | |
| runs-on: ${{ matrix.config.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| config: | |
| - { name: "Ubuntu 24.04 CPM", os: ubuntu-24.04, preset: "linux-cpm", arch: "x86_64"} | |
| - { name: "Ubuntu 24.04 Local", os: ubuntu-24.04, preset: "linux-local", arch: "x86_64"} | |
| - { name: "Ubuntu 24.04 CPM arm", os: ubuntu-24.04-arm, preset: "linux-cpm", arch: "arm" } | |
| - { name: "Ubuntu 24.04 Local arm", os: ubuntu-24.04-arm, preset: "linux-local", arch: "arm" } | |
| - { name: "Ubuntu 24.04 AppImage", os: ubuntu-24.04, preset: "linux-appimage", arch: "x86_64" } | |
| - { name: "Ubuntu 24.04 AppImage arm", os: ubuntu-24.04-arm, preset: "linux-appimage", arch: "arm" } | |
| - { name: "Ubuntu 22.04 CPM", os: ubuntu-22.04, preset: "linux-cpm", arch: "x86_64" } | |
| - { name: "Ubuntu 22.04 CPM arm", os: ubuntu-22.04-arm, preset: "linux-cpm", arch: "arm" } | |
| # ubuntu 22.04 had openexr 2, but we require 3 | |
| # - { name: "Ubuntu 22.04 Local", os: ubuntu-22.04, preset: "linux-local" } | |
| buildtype: [Release, Debug] | |
| steps: | |
| - name: Install dependencies (Ubuntu 24.04) | |
| if: startsWith(matrix.config.os, 'ubuntu-24.04') | |
| run: sudo apt-get update && sudo apt-get install -y cmake xorg-dev libglu1-mesa-dev zlib1g-dev libxrandr-dev ninja-build libglfw3-dev libfreetype-dev libjpeg-dev libimath-dev libopenexr-dev libpng-dev libtiff-dev liblcms2-dev libwebp-dev libraw-dev libheif-dev libaom-dev libde265-dev libx265-dev libjxl-dev libcli11-dev libspdlog-dev libfmt-dev libexif-dev libwayland-dev wayland-protocols libopenh264-dev libopenjp2-7-dev | |
| - name: Install dependencies (Ubuntu 22.04) | |
| if: startsWith(matrix.config.os, 'ubuntu-22.04') | |
| run: sudo apt-get update && sudo apt-get install -y cmake xorg-dev libglu1-mesa-dev zlib1g-dev libxrandr-dev ninja-build libglfw3-dev libfreetype-dev libjpeg-dev libpng-dev libtiff-dev liblcms2-dev libwebp-dev libraw-dev libheif-dev libaom-dev libde265-dev libx265-dev libcli11-dev libspdlog-dev libfmt-dev libwayland-dev wayland-protocols libopenh264-dev libopenjp2-7-dev | |
| - name: Install Python dependencies | |
| run: pip install --upgrade pip && pip install Pillow | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set version variables | |
| run: | | |
| VERSION="${{ github.ref_name }}" | |
| VERSION_NO_V="${VERSION#v}" | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| echo "VERSION_NO_V=$VERSION_NO_V" >> $GITHUB_ENV | |
| - uses: actions/cache@v4 | |
| with: | |
| path: "**/cpm_modules" | |
| key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} | |
| # Setup caching of build artifacts to reduce total build time (only Linux and MacOS) | |
| - name: ccache | |
| uses: hendrikmuhs/ccache-action@v1.2 | |
| with: | |
| key: ${{ matrix.config.os }}-${{ matrix.config.preset }}-${{ matrix.buildtype }} | |
| - name: Configure CMake | |
| run: | | |
| cmake --preset ${{ matrix.config.preset }} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
| - name: Build | |
| run: | | |
| BUILDTYPE_LOWER=$(echo "${{ matrix.buildtype }}" | tr '[:upper:]' '[:lower:]') | |
| cmake --build --preset ${{ matrix.config.preset }}-${BUILDTYPE_LOWER} | |
| - name: Checking that HDRView runs | |
| run: | | |
| ${{github.workspace}}/build/${{ matrix.config.preset }}/${{ matrix.buildtype }}/HDRView --help | |
| - name: Package | |
| if: matrix.config.preset == 'linux-appimage' | |
| working-directory: ${{github.workspace}}/build/${{ matrix.config.preset }} | |
| run: cpack -C ${{ matrix.buildtype }} -G External | |
| - name: Archive package | |
| if: matrix.config.preset == 'linux-appimage' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: appimage-${{ matrix.config.os }}-${{ matrix.buildtype }} | |
| path: | | |
| ${{github.workspace}}/build/${{ matrix.config.preset }}/*.appimage | |
| - name: Archive build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-artifacts-${{ matrix.config.os }}-${{ matrix.config.preset }}-${{ matrix.buildtype }} | |
| path: | | |
| ${{github.workspace}}/build/${{ matrix.config.preset }}/${{ matrix.buildtype }} |