name: On PRs - Windows Matrix concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true on: pull_request: paths-ignore: - "*.md" workflow_dispatch: push: branches: - main tags: - '!*' paths-ignore: - "*.md" jobs: windows: name: 'Win10 Arch: ${{matrix.platform}} BuildType:${{matrix.build_type}} - SHARED:${{matrix.shared_libraries}}' runs-on: windows-2022 strategy: fail-fast: false matrix: build_type: [Release, Debug] shared_libraries: [ON, OFF] platform: [ x64, x86 ] steps: - uses: actions/checkout@v3 - name: Set up Visual Studio shell uses: egor-tensin/vs-shell@v2 with: arch: ${{matrix.platform}} - name: Set up Ninja uses: ashutoshvarma/setup-ninja@master with: version: 1.10.0 - name: Set up Python uses: actions/setup-python@v3 with: python-version: 3.7 - name: Restore Conan cache uses: actions/cache@v2 with: path: ${{github.workspace}}/conanCache key: ${{runner.os}}-${{matrix.platform}}-${{matrix.build_type}}-Shared${{matrix.shared_libraries}}-${{ hashFiles('conanfile.py') }} - name: Install Conan & Common config run: | pip.exe install "conan==1.54.0" conan config install https://github.com/conan-io/conanclientcert.git conan profile new --detect default conan profile update settings.build_type=${{matrix.build_type}} default conan profile update settings.compiler="Visual Studio" default conan profile update settings.compiler.version=17 default conan config set storage.path=$Env:GITHUB_WORKSPACE/conanCache - name: Conan Arch conditional config if: ${{matrix.platform == 'x86'}} run: | conan profile update settings.arch=x86 default conan profile update settings.arch_build=x86 default - name: Run Conan run: | md build cd build conan profile list conan install .. --build missing - name: Build run: | cmake --preset base_windows -S . -B build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DBUILD_SHARED_LIBS=${{matrix.shared_libraries}} -DEXIV2_ENABLE_VIDEO=ON cmake --build build --parallel - name: Install run: | cmake --install build - name: Test if: ${{matrix.platform == 'x64'}} run: | ctest --test-dir build --output-on-failure msys2: runs-on: windows-latest timeout-minutes: 40 strategy: fail-fast: false matrix: build_type: [Release, Debug] shared_libraries: [ON, OFF] sys: [UCRT64] name: MSYS2 ${{matrix.sys}} - BuildType:${{matrix.build_type}} - SHARED:${{matrix.shared_libraries}} defaults: run: shell: msys2 {0} steps: - uses: actions/checkout@v3 - name: Set up MSYS2 uses: msys2/setup-msys2@v2 with: path-type: strict msystem: ${{matrix.sys}} update: true pacboy: >- cc:p gcc-libs:p libwinpthread:p cmake:p ninja:p python:p gtest:p brotli:p curl:p expat:p libiconv:p libinih:p zlib:p - name: Build run: | cmake --preset base_windows \ -DCMAKE_CXX_FLAGS=-Wno-deprecated \ -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ -DBUILD_SHARED_LIBS=${{matrix.shared_libraries}} \ -DCONAN_AUTO_INSTALL=OFF \ -DEXIV2_TEAM_WARNINGS_AS_ERRORS=OFF \ -DEXIV2_ENABLE_VIDEO=ON \ -DPython3_EXECUTABLE=${MINGW_PREFIX}/bin/python.exe \ -S . -B build && \ cmake --build build --parallel - name: Test run: | ctest --test-dir build --output-on-failure cygwin: runs-on: windows-latest strategy: fail-fast: false matrix: build_type: [Release] shared_libraries: [ON] platform: [x86_64] name: Cygwin ${{matrix.platform}} - BuildType:${{matrix.build_type}} - SHARED:${{matrix.shared_libraries}} env: SHELLOPTS: igncr defaults: run: shell: C:\cygwin\bin\bash.exe -eo pipefail '{0}' steps: # Make sure we don't check out scripts using Windows CRLF line endings - run: git config --global core.autocrlf input shell: pwsh - uses: actions/checkout@v3 - name: Set up Cygwin uses: cygwin/cygwin-install-action@v3 with: platform: ${{matrix.platform}} packages: >- gcc-g++ cmake ninja pkg-config python3 libbrotli-devel libcurl-devel libexpat-devel libiconv-devel libinih-devel zlib-devel - name: Build run: | cmake --preset base_windows \ -DCMAKE_CXX_FLAGS=-Wno-deprecated \ -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ -DBUILD_SHARED_LIBS=${{matrix.shared_libraries}} \ -DCONAN_AUTO_INSTALL=OFF \ -DEXIV2_BUILD_SAMPLES=OFF \ -DEXIV2_BUILD_UNIT_TESTS=OFF \ -DEXIV2_TEAM_WARNINGS_AS_ERRORS=OFF \ -DEXIV2_ENABLE_VIDEO=ON \ -S . -B build && \ cmake --build build --parallel - name: Test run: | ctest --test-dir build --output-on-failure