From 589079af40d4cc3d52fe6aef5139bbe5c6aa9dbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Komar=C4=8Devi=C4=87?= Date: Fri, 17 Dec 2021 11:19:37 +0100 Subject: [PATCH] Switch Cygwin CI to GHA --- .github/workflows/on_PR_windows_matrix.yml | 80 ++++++++++++++++++---- appveyor_mingw_cygwin.yml | 36 ---------- 2 files changed, 68 insertions(+), 48 deletions(-) delete mode 100644 appveyor_mingw_cygwin.yml diff --git a/.github/workflows/on_PR_windows_matrix.yml b/.github/workflows/on_PR_windows_matrix.yml index 688a3b2539..05e88cdd9a 100644 --- a/.github/workflows/on_PR_windows_matrix.yml +++ b/.github/workflows/on_PR_windows_matrix.yml @@ -28,7 +28,7 @@ jobs: with: arch: ${{matrix.platform}} - - name: Setup Ninja + - name: Set up Ninja uses: ashutoshvarma/setup-ninja@master with: version: 1.10.0 @@ -38,7 +38,7 @@ jobs: with: python-version: 3.7 - - name: Restore conan cache + - name: Restore Conan cache uses: actions/cache@v2 with: path: ${{github.workspace}}/conanCache @@ -71,9 +71,18 @@ jobs: - name: Build run: | - cd build - cmake -GNinja -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DBUILD_SHARED_LIBS=${{matrix.shared_libraries}} -DEXIV2_ENABLE_NLS=OFF -DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_BUILD_UNIT_TESTS=ON -DEXIV2_ENABLE_WIN_UNICODE=OFF -DEXIV2_TEAM_WARNINGS_AS_ERRORS=ON -DEXIV2_ENABLE_BMFF=ON -DCMAKE_INSTALL_PREFIX=install .. - cmake --build . + cmake -GNinja ` + -DCMAKE_BUILD_TYPE=${{matrix.build_type}} ` + -DBUILD_SHARED_LIBS=${{matrix.shared_libraries}} ` + -DEXIV2_ENABLE_NLS=OFF ` + -DEXIV2_ENABLE_WIN_UNICODE=OFF ` + -DEXIV2_ENABLE_WEBREADY=ON ` + -DEXIV2_ENABLE_BMFF=ON ` + -DEXIV2_BUILD_UNIT_TESTS=ON ` + -DEXIV2_TEAM_WARNINGS_AS_ERRORS=ON ` + -DCMAKE_INSTALL_PREFIX=install ` + -S . -B build && ` + cmake --build build - name: Install run: | @@ -99,13 +108,9 @@ jobs: run: shell: msys2 {0} steps: + - uses: actions/checkout@v2 - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup MSYS2 + - name: Set up MSYS2 uses: msys2/setup-msys2@v2 with: msystem: ${{matrix.sys}} @@ -134,7 +139,58 @@ jobs: -DEXIV2_ENABLE_WEBREADY=ON \ -DEXIV2_ENABLE_BMFF=ON \ -DEXIV2_BUILD_UNIT_TESTS=ON \ - -S . -B build + -S . -B build && \ + cmake --build build + + - 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: [x64] + name: Cygwin ${{matrix.platform}} - BuildType:${{matrix.build_type}} - SHARED:${{matrix.shared_libraries}} + env: + SHELLOPTS: igncr + defaults: + run: + shell: C:\tools\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@v2 + + - name: Set up Cygwin + uses: egor-tensin/setup-cygwin@v3 + with: + platform: ${{matrix.platform}} + packages: >- + gcc-g++ + cmake + ninja + libexpat-devel + libxml2-devel + libxslt-devel + python38-lxml + zlib-devel + - name: Build + run: | + cmake -GNinja \ + -DCMAKE_CXX_FLAGS=-Wno-deprecated \ + -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ + -DBUILD_SHARED_LIBS=${{matrix.shared_libraries}} \ + -DEXIV2_ENABLE_NLS=OFF \ + -DEXIV2_ENABLE_WIN_UNICODE=OFF \ + -DEXIV2_ENABLE_WEBREADY=ON \ + -DEXIV2_ENABLE_BMFF=ON \ + -DEXIV2_BUILD_UNIT_TESTS=OFF \ + -S . -B build && \ cmake --build build - name: Test diff --git a/appveyor_mingw_cygwin.yml b/appveyor_mingw_cygwin.yml deleted file mode 100644 index 97892819f4..0000000000 --- a/appveyor_mingw_cygwin.yml +++ /dev/null @@ -1,36 +0,0 @@ -image: Visual Studio 2019 - -shallow_clone: true - -environment: - BUILD: CYGWIN64 - INTEGRATION_TESTS: 1 - ARCHITECTURE: x86_64 - UNIT_TESTS: 1 - WEBREADY: False - WARNINGS_AS_ERRORS: ON - -install: - - set "PATH=C:\cygwin64\usr\local\bin;C:\cygwin64\bin;C:\cygwin64\usr\bin;C:\cygwin64\usr\sbin;" - - C:\cygwin64\bin\bash -c "wget -O /usr/local/bin/apt-cyg https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg ; chmod +x /usr/local/bin/apt-cyg" - # Issue:#2003 Change mirror used by apt-cyg. cmake installed by default mirror is broken - - C:\cygwin64\bin\bash -c "apt-cyg mirror http://mirrors.kernel.org/sources.redhat.com/cygwin/" - - C:\cygwin64\bin\bash -c "apt-cyg install cmake libexpat-devel libxml2-devel libxslt-devel python38-lxml zlib-devel" - # As a last resort, build CMake from source. Caution: This takes about 60 minutes. - # - C:\cygwin64\bin\bash -c "cd /tmp; curl -LO https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1.tar.gz; tar xfz cmake-3.22.1.tar.gz; cd cmake-3.22.1 ; ./bootstrap ; make ; make install" - -build_script: - - set CMD=mkdir -p build - - set CMD=%CMD%; cd build - - set CMD=%CMD%; cmake .. -G 'Unix Makefiles' -DCMAKE_CXX_FLAGS=-Wno-deprecated - - set CMD=%CMD%; cmake --build . --config Release - - echo %CMD% - - cd %APPVEYOR_BUILD_FOLDER% - - C:\cygwin64\bin\bash -c "%CMD%" - -test_script: - - set CMD=cd build - - set CMD=%CMD%; ctest --output-on-failure - - echo %CMD% - - cd %APPVEYOR_BUILD_FOLDER% - - C:\cygwin64\bin\bash -c "%CMD%"