Skip to content

Commit

Permalink
Merge pull request #2019 from Exiv2/ci_mingw_gha
Browse files Browse the repository at this point in the history
Switch MinGW CI to GHA
  • Loading branch information
clanmills authored Dec 10, 2021
2 parents 2fb3f79 + 95aa2ca commit 2cbdfac
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 100 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/on_PR_linux_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ jobs:
tree install
- name: Test
env:
EXIV2_EXT: .exe
run: |
cd build
cmake --build . --target tests
24 changes: 0 additions & 24 deletions .github/workflows/on_PR_linux_special_buils.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ jobs:
cmake --build .
- name: Tests + Upload coverage
env:
EXIV2_EXT: .exe
run: |
cd build
cmake --build . --target tests
Expand Down Expand Up @@ -87,8 +85,6 @@ jobs:
cmake --build .
- name: Tests with valgrind
env:
EXIV2_EXT: .exe
run: |
cd build/bin
valgrind ./unit_tests
Expand Down Expand Up @@ -126,8 +122,6 @@ jobs:
cmake --build .
- name: Tests
env:
EXIV2_EXT: .exe
run: |
cd build
cmake --build . --target tests
Expand Down Expand Up @@ -167,21 +161,3 @@ jobs:
- name: Generate documentation
run: |
make doc
special_FedoraMinGW:
name: 'Fedora MinGW'
runs-on: ubuntu-latest
container:
image: "fedora:latest"

steps:
- uses: actions/checkout@v2

- name: install dependencies
run: |
dnf -y upgrade
dnf -y install mingw64-gcc-c++ mingw64-filesystem mingw64-expat mingw64-zlib cmake make
- name: Build
run:
python3 ci/test_build.py --without-tests --cmake-executable "mingw64-cmake" --cmake-options "-DEXIV2_TEAM_EXTRA_WARNINGS=OFF -DEXIV2_TEAM_WARNINGS_AS_ERRORS=OFF -DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_ENABLE_WIN_UNICODE=ON " --compilers --shared-libs OFF
2 changes: 0 additions & 2 deletions .github/workflows/on_PR_mac_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ jobs:
cmake --build . --target install
- name: Test
env:
EXIV2_EXT: .exe
run: |
cd build
cmake --build . --target tests
68 changes: 61 additions & 7 deletions .github/workflows/on_PR_windows_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
build_type: [Release, Debug]
shared_libraries: [ON, OFF]
platform: [ x64, x86 ]

steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -68,23 +68,77 @@ jobs:
conan install .. --build missing
dir ..
tree /f ../conanCache
- 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_PNG=ON -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 ..
ninja
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 .
- name: Install
run: |
cd build
ninja install
cmake --install .
tree /f install
- name: Test
if: ${{matrix.platform == 'x64'}}
env:
EXIV2_EXT: .exe
run: |
cd build
cmake --build . --target tests
msys2:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
build_type: [Release, Debug]
shared_libraries: [ON, OFF]
sys: [MINGW64]
name: MSYS2 ${{matrix.sys}} - BuildType:${{matrix.build_type}} - SHARED:${{matrix.shared_libraries}}
defaults:
run:
shell: msys2 {0}
steps:

- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
update: true
install: >-
base-devel
pacboy: >-
toolchain:p
cmake:p
ninja:p
expat:p
gettext:p
gtest:p
libiconv:p
python-lxml:p
zlib:p
- name: Build
run: |
cmake -GNinja \
-DCMAKE_CXX_STANDARD=98 \
-DCMAKE_CXX_FLAGS=-Wno-deprecated \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DBUILD_SHARED_LIBS=${{matrix.shared_libraries}} \
-DEXIV2_ENABLE_NLS=ON \
-DEXIV2_ENABLE_WIN_UNICODE=ON \
-DEXIV2_ENABLE_WEBREADY=ON \
-DEXIV2_ENABLE_BMFF=ON \
-DEXIV2_BUILD_UNIT_TESTS=ON \
-S . -B build
cmake --build build
- name: Test
run: |
cmake --build build --target tests
2 changes: 0 additions & 2 deletions .github/workflows/on_push_ExtraJobsForMain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ jobs:
make -j
- name: Tests + Upload coverage
env:
EXIV2_EXT: .exe
run: |
cd build
cmake --build . --target tests
Expand Down
86 changes: 30 additions & 56 deletions appveyor_mingw_cygwin.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,36 @@
init:
- echo %PYTHON%

environment:
PYTHON: "C:/Python37-x64"

matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
BUILD: MINGW64
INTEGRATION_TESTS: 1
ARCHITECTURE: x86_64
UNIT_TESTS: 1
WEBREADY: False
WARNINGS_AS_ERRORS: ON
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
BUILD: CYGWIN64
INTEGRATION_TESTS: 1
ARCHITECTURE: x86_64
UNIT_TESTS: 1
WEBREADY: False
WARNINGS_AS_ERRORS: ON
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:
- echo %APPVEYOR_BUILD_FOLDER%
- if "%BUILD%"=="MINGW64" C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S --needed base-devel mingw-w64-x86_64-{toolchain,cmake,expat,gettext,gtest,libiconv,python-lxml,zlib}"
- if "%BUILD%"=="MINGW64" set "PATH=C:\msys64\mingw64\bin;C:\msys64\usr\local\bin;C:\msys64\usr\bin;C:\msys64\bin;"
- cd %APPVEYOR_BUILD_FOLDER%
- if "%BUILD%"=="CYGWIN64" set "PATH=c:\cygwin64\usr\local\bin;c:\cygwin64\bin;c:\cygwin64\usr\bin;c:\cygwin64\usr\sbin;"
- if "%BUILD%"=="CYGWIN64" C:\cygwin64\bin\bash -c "wget https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg ; chmod +x apt-cyg; mv apt-cyg /usr/local/bin"
# Issue:#2003 Change mirror used by apt-cyg. cmake installed by default mirror is broken
- if "%BUILD%"=="CYGWIN64" C:\cygwin64\bin\bash -c "apt-cyg mirror http://mirrors.kernel.org/sources.redhat.com/cygwin/"
- if "%BUILD%"=="CYGWIN64" 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.
# if "%BUILD%"=="CYGWIN64" C:\cygwin64\bin\bash -c "cd /tmp; curl -LO https://github.com/Kitware/CMake/releases/download/v3.22.0/cmake-3.22.0.tar.gz; tar xfz cmake-3.22.0.tar.gz; cd cmake-3.22.0 ; ./bootstrap ; make ; make 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:
- cmd: set CMD=mkdir -p build
- cmd: set CMD=%CMD%; cd build
- cmd: set CMD=%CMD%; cmake .. -G 'Unix Makefiles' -DCMAKE_CXX_STANDARD=98 -DCMAKE_CXX_FLAGS=-Wno-deprecated
- cmd: set CMD=%CMD%; cmake --build . --config Release
- cmd: rem echo %CMD%
- cd %APPVEYOR_BUILD_FOLDER%
- cmd: if "%BUILD%"=="MINGW64" C:\msys64\usr\bin\bash -c "%CMD%"
- cmd: set CMD=which python3 python
- cmd: set CMD=%CMD%; python --version
- cmd: set CMD=%CMD%; build/bin/exiv2 --verbose --version; pwd ; ls -l
- cmd: set CMD=%CMD%; cd build ; cmake --build . --config Release --target python_tests
- cmd: echo %CMD%
- cd %APPVEYOR_BUILD_FOLDER%
- cmd: if "%BUILD%"=="MINGW64" C:\msys64\usr\bin\bash -c "%CMD%"
- cmd: set "PATH=c:\cygwin64\usr\local\bin;c:\cygwin64\bin;c:\cygwin64\usr\bin;c:\cygwin64\usr\sbin;"
- cmd: set CMD=cmake.exe --version
- cmd: set CMD=%CMD%; mkdir -p build
- cmd: set CMD=%CMD%; cd build
- cmd: set CMD=%CMD%; cmake.exe .. -G 'Unix Makefiles' -DCMAKE_CXX_STANDARD=98 -DCMAKE_CXX_FLAGS=-Wno-deprecated
- cmd: set CMD=%CMD%; cmake.exe --build . --config Release
- cmd: set CMD=%CMD%; cmake.exe --build . --target python_tests --config Release
- cmd: echo %CMD%
- cd %APPVEYOR_BUILD_FOLDER%
- cmd: if "%BUILD%"=="CYGWIN64" C:\cygwin64\bin\bash.exe -c "%CMD%"
- set CMD=mkdir -p build
- set CMD=%CMD%; cd build
- set CMD=%CMD%; cmake .. -G 'Unix Makefiles' -DCMAKE_CXX_STANDARD=98 -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%; cmake --build . --config Release --target python_tests
- echo %CMD%
- cd %APPVEYOR_BUILD_FOLDER%
- C:\cygwin64\bin\bash -c "%CMD%"
10 changes: 5 additions & 5 deletions src/convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#endif
#include <cstring>

#if defined WIN32 && !defined __CYGWIN__
#if defined _WIN32 && !defined __CYGWIN__
# include <windows.h>
#endif

Expand All @@ -71,7 +71,7 @@
// *****************************************************************************
// local declarations
namespace {
#if defined WIN32 && !defined __CYGWIN__
#if !defined EXV_HAVE_ICONV && defined _WIN32 && !defined __CYGWIN__
// Convert string charset with Windows functions.
bool convertStringCharsetWindows(std::string& str, const char* from, const char* to);
#endif
Expand Down Expand Up @@ -1354,7 +1354,7 @@ namespace Exiv2 {
bool ret = false;
#if defined EXV_HAVE_ICONV
ret = convertStringCharsetIconv(str, from, to);
#elif defined WIN32 && !defined __CYGWIN__
#elif defined _WIN32 && !defined __CYGWIN__
ret = convertStringCharsetWindows(str, from, to);
#else
# ifndef SUPPRESS_WARNINGS
Expand All @@ -1372,7 +1372,7 @@ namespace {

using namespace Exiv2;

#if defined WIN32 && !defined __CYGWIN__
#if !defined EXV_HAVE_ICONV && defined _WIN32 && !defined __CYGWIN__
bool swapBytes(std::string& str)
{
// Naive byte-swapping, I'm sure this can be done more efficiently
Expand Down Expand Up @@ -1526,7 +1526,7 @@ namespace {
return ret;
}

#endif // defined WIN32 && !defined __CYGWIN__
#endif // !defined EXV_HAVE_ICONV && defined _WIN32 && !defined __CYGWIN__
#if defined EXV_HAVE_ICONV
bool convertStringCharsetIconv(std::string& str, const char* from, const char* to)
{
Expand Down
6 changes: 4 additions & 2 deletions src/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,8 @@ namespace Exiv2 {
if (useCurl && (fProt == pHttp || fProt == pHttps || fProt == pFtp)) {
return BasicIo::AutoPtr(new CurlIo(path)); // may throw
}
#else
(void)(useCurl);
#endif

if (fProt == pHttp)
Expand All @@ -892,8 +894,6 @@ namespace Exiv2 {
return BasicIo::AutoPtr(new XPathIo(path)); // may throw

return BasicIo::AutoPtr(new FileIo(path));

(void)(useCurl);
} // ImageFactory::createIo

#ifdef EXV_UNICODE_PATH
Expand All @@ -909,6 +909,8 @@ namespace Exiv2 {
if (useCurl && (fProt == pHttp || fProt == pHttps || fProt == pFtp)) {
return BasicIo::AutoPtr(new CurlIo(wpath));
}
#else
(void)(useCurl);
#endif
if (fProt == pHttp)
return BasicIo::AutoPtr(new HttpIo(wpath));
Expand Down

0 comments on commit 2cbdfac

Please sign in to comment.