Fix pipeline #116
Workflow file for this run
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: C/C++ CI | |
| on: | |
| push: | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| #ubuntu-latest, macos-latest, windows-latest] | |
| include: | |
| - os: windows-latest | |
| triplet: x64-windows | |
| - os: ubuntu-latest | |
| triplet: x64-linux | |
| # - os: macos-latest | |
| # triplet: x64-osx | |
| continue-on-error: true | |
| env: | |
| VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite' | |
| steps: | |
| - name: Set OS environment variable in lowercase letters | |
| run: echo "CURRENT_OS=$(echo $RUNNER_OS | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | |
| shell: bash | |
| - name: Set up cache | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | |
| core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | |
| - uses: actions/checkout@v4 | |
| - name: Create vcpkg default binary cache | |
| run: | | |
| if [ "$RUNNER_OS" == "Windows" ]; then | |
| mkdir -p ${{ github.workspace }}\vcpkg\bincache | |
| else | |
| mkdir -p ${{ github.workspace }}/vcpkg/bincache | |
| fi | |
| shell: bash | |
| - name: Install packages | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get install -y libxi-dev libxtst-dev bison gperf libgles2-mesa-dev libxrandr-dev libxcursor-dev libxdamage-dev libxinerama-dev nasm autoconf automake libtool pkg-config libltdl-dev | |
| - if: runner.os == 'macOS' | |
| run: brew install nasm | |
| - uses: lukka/get-cmake@v3.26.0 | |
| - name: Set up vcpkg | |
| uses: lukka/run-vcpkg@v11 | |
| with: | |
| setupOnly: true | |
| vcpkgGitCommitId: d320630b28aeb59b24424eb2a7ef3905314107a1 | |
| # Restore vpkg cache | |
| - name: Restore vcpkg | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ${{ env._VCPKG_ }} | |
| !${{ env._VCPKG_ }}/buildtrees | |
| !${{ env._VCPKG_ }}/packages | |
| !${{ env._VCPKG_ }}/downloads | |
| !${{ env._VCPKG_ }}/installed | |
| key: | | |
| ${{ hashFiles( '.git/modules/vcpkg/HEAD' )}} | |
| # Ensure that the developer command promt is present on Windows runners | |
| - uses: ilammy/msvc-dev-cmd@v1 | |
| - name: Run CMake consuming CMakePreset.json and run vcpkg to build packages | |
| uses: lukka/run-cmake@v10 | |
| with: | |
| configurePreset: ${{ env.CURRENT_OS }}-release | |
| configurePresetAdditionalArgs: "['-DBUILD_EXAMPLE_APP=ON','-DBUILD_TESTS=ON']" | |
| buildPreset: ${{ env.CURRENT_OS }}-release | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-artifacts-${{ env.CURRENT_OS }} | |
| path: | | |
| bin/build/${{ env.CURRENT_OS }}-release/example | |
| bin/build/${{ env.CURRENT_OS }}-release/test/Iris.Tests | |
| bin/build/${{ env.CURRENT_OS }}-release/test/AddressSanitizer.Tests | |
| bin/build/${{ env.CURRENT_OS }}-release/CTestTestfile.cmake | |
| - name: Upload vcpkg logs on fail | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: vckpg-fail-logs | |
| path: | | |
| D:\a\fonttik\fonttik\bin\build\windows-release\vcpkg_installed\vcpkg\blds\opencv4\*.log | |
| retention-days: 1 | |
| test: | |
| needs: build | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| #ubuntu-latest, macos-latest, windows-latest] | |
| include: | |
| - os: windows-latest | |
| triplet: x64-windows | |
| - os: ubuntu-latest | |
| triplet: x64-linux | |
| # - os: macos-latest | |
| # triplet: x64-osx | |
| continue-on-error: true | |
| if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main') | |
| steps: | |
| - name: Set environment variable in lowercase letters | |
| run: echo "CURRENT_OS=$(echo $RUNNER_OS | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | |
| shell: bash | |
| - uses: actions/checkout@v4 | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build-artifacts-${{ env.CURRENT_OS }} | |
| path: bin/build/${{ env.CURRENT_OS }}-release | |
| - name: Set permissions | |
| if: runner.os == 'linux' || runner.os == 'macOS' | |
| run: | | |
| if [ "$RUNNER_OS" == "linux" ]; then | |
| sudo apt-get update && sudo apt-get install -y libegl1-mesa && sudo chmod +x bin/build/linux-release/test/Iris.Tests/iris_tests | |
| elif [ "$RUNNER_OS" == "macOS" ]; then | |
| chmod 755 bin/build/macos-release/test/Iris.Tests/iris_tests | |
| fi | |
| shell: bash | |
| - name: Test | |
| run: | | |
| ctest --preset test-${{ env.CURRENT_OS }} | |