mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-06-28 15:39:02 +08:00
Windows GitHub Action (#231)
* Migrate the Windows Msys2 build from Appveyor to GitHub Actions * Fix build with newer versions of Msys2 (fix `vasprintf` conflict) * Enable SQL tests on the Cygwin build on Appveyor * Fix an error message about Bison not being available when in fact Flex was not available * Don't fail fast with Mac and Linux GitHub Actions
This commit is contained in:
parent
76c2ada332
commit
2becb08714
20
.github/workflows/build.yml
vendored
20
.github/workflows/build.yml
vendored
@ -4,6 +4,7 @@ jobs:
|
|||||||
linux:
|
linux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
compiler: [ clang, gcc, gcc-8, gcc-9, gcc-10 ]
|
compiler: [ clang, gcc, gcc-8, gcc-9, gcc-10 ]
|
||||||
glib: [ enable-glib, disable-glib ]
|
glib: [ enable-glib, disable-glib ]
|
||||||
@ -34,6 +35,7 @@ jobs:
|
|||||||
macos:
|
macos:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
compiler: [ clang, gcc ]
|
compiler: [ clang, gcc ]
|
||||||
glib: [ enable-glib, disable-glib ]
|
glib: [ enable-glib, disable-glib ]
|
||||||
@ -87,3 +89,21 @@ jobs:
|
|||||||
run: make
|
run: make
|
||||||
- name: ODBC tests
|
- name: ODBC tests
|
||||||
run: env MDBPATH=test/data ./src/odbc/unittest
|
run: env MDBPATH=test/data ./src/odbc/unittest
|
||||||
|
windows:
|
||||||
|
runs-on: windows-latest
|
||||||
|
env:
|
||||||
|
MSYSTEM: MINGW64
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Check out test data
|
||||||
|
run: git clone https://github.com/mdbtools/mdbtestdata.git test
|
||||||
|
- name: Autoconf
|
||||||
|
run: C:\msys64\usr\bin\bash -c -l 'cd "$GITHUB_WORKSPACE" && autoreconf -i -f'
|
||||||
|
- name: Configure
|
||||||
|
run: C:\msys64\usr\bin\bash -c -l 'cd "$GITHUB_WORKSPACE" && ./configure'
|
||||||
|
- name: Make
|
||||||
|
run: C:\msys64\usr\bin\bash -c -l 'cd "$GITHUB_WORKSPACE" && make'
|
||||||
|
- name: Test
|
||||||
|
run: C:\msys64\usr\bin\bash -c -l 'cd "$GITHUB_WORKSPACE" && ./test_script.sh'
|
||||||
|
- name: SQL Test
|
||||||
|
run: C:\msys64\usr\bin\bash -c -l 'cd "$GITHUB_WORKSPACE" && ./test_sql.sh'
|
||||||
|
36
appveyor.yml
36
appveyor.yml
@ -6,7 +6,6 @@ platform: x64
|
|||||||
|
|
||||||
environment:
|
environment:
|
||||||
matrix:
|
matrix:
|
||||||
- TOOLCHAIN: "msys2"
|
|
||||||
- TOOLCHAIN: "cygwin"
|
- TOOLCHAIN: "cygwin"
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
@ -19,33 +18,12 @@ clone_folder: c:\projects\mdbtools
|
|||||||
skip_tags: true
|
skip_tags: true
|
||||||
|
|
||||||
build_script:
|
build_script:
|
||||||
- ps: |
|
- C:\cygwin64\setup-x86_64.exe -q -P bison -P flex -P libiconv-devel
|
||||||
if ($env:TOOLCHAIN -eq "msys2")
|
- C:\cygwin64\bin\sh -lc "cd /cygdrive/c/projects/mdbtools && git clone https://github.com/mdbtools/mdbtestdata.git test"
|
||||||
{
|
- C:\cygwin64\bin\sh -lc "cd /cygdrive/c/projects/mdbtools && autoreconf -i -f"
|
||||||
$env:MSYSTEM="MINGW64"
|
- C:\cygwin64\bin\sh -lc "cd /cygdrive/c/projects/mdbtools && ./configure --disable-man --disable-silent-rules"
|
||||||
C:\msys64\usr\bin\bash -l -c "cd /c/projects/mdbtools && git clone https://github.com/mdbtools/mdbtestdata.git test"
|
- C:\cygwin64\bin\sh -lc "cd /cygdrive/c/projects/mdbtools && make"
|
||||||
C:\msys64\usr\bin\bash -l -c "cd /c/projects/mdbtools && autoreconf -i -f"
|
|
||||||
C:\msys64\usr\bin\bash -l -c "cd /c/projects/mdbtools && ./configure --disable-man --disable-silent-rules"
|
|
||||||
C:\msys64\usr\bin\bash -l -c "cd /c/projects/mdbtools && make"
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
C:\cygwin64\setup-x86_64.exe -qP bison flex libiodbc-devel
|
|
||||||
C:\cygwin64\bin\sh -lc "cd /cygdrive/c/projects/mdbtools && git clone https://github.com/mdbtools/mdbtestdata.git test"
|
|
||||||
C:\cygwin64\bin\sh -lc "cd /cygdrive/c/projects/mdbtools && autoreconf -i -f"
|
|
||||||
C:\cygwin64\bin\sh -lc "cd /cygdrive/c/projects/mdbtools && ./configure --disable-man --disable-silent-rules"
|
|
||||||
C:\cygwin64\bin\sh -lc "cd /cygdrive/c/projects/mdbtools && make"
|
|
||||||
}
|
|
||||||
|
|
||||||
test_script:
|
test_script:
|
||||||
- ps: |
|
- C:\cygwin64\bin\sh -lc "cd /cygdrive/c/projects/mdbtools && ./test_script.sh"
|
||||||
if ($env:TOOLCHAIN -eq "msys2")
|
- C:\cygwin64\bin\sh -lc "cd /cygdrive/c/projects/mdbtools && ./test_sql.sh"
|
||||||
{
|
|
||||||
$env:MSYSTEM="MINGW64"
|
|
||||||
C:\msys64\usr\bin\bash -l -c "cd /c/projects/mdbtools && ./test_script.sh"
|
|
||||||
C:\msys64\usr\bin\bash -l -c "cd /c/projects/mdbtools && ./test_sql.sh"
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
C:\cygwin64\bin\sh -lc "cd /cygdrive/c/projects/mdbtools && ./test_script.sh"
|
|
||||||
}
|
|
||||||
|
@ -36,7 +36,7 @@ AC_CHECK_DECLS([program_invocation_short_name], [], [], [[
|
|||||||
|
|
||||||
dnl Checks for library functions.
|
dnl Checks for library functions.
|
||||||
VL_LIB_READLINE
|
VL_LIB_READLINE
|
||||||
AC_CHECK_FUNCS(strptime fmemopen gmtime_r wcstombs_l)
|
AC_CHECK_FUNCS(strptime fmemopen gmtime_r wcstombs_l vasprintf vasnprintf)
|
||||||
|
|
||||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||||
AC_C_CONST
|
AC_C_CONST
|
||||||
@ -73,14 +73,13 @@ if $YACC -V | grep "bison.* 3[.]" >/dev/null 2>&1; then
|
|||||||
YFLAGS="$YFLAGS -Wno-yacc"
|
YFLAGS="$YFLAGS -Wno-yacc"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
sql=false
|
AC_MSG_WARN([Bison 3.0+ is not available: SQL disabled.])
|
||||||
|
sql=false
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "x$sql" = "xtrue"; then
|
if test "x$sql" = "xtrue"; then
|
||||||
CFLAGS="$CFLAGS -DSQL"
|
CFLAGS="$CFLAGS -DSQL"
|
||||||
OPTDIRS="$OPTDIRS sql"
|
OPTDIRS="$OPTDIRS sql"
|
||||||
else
|
|
||||||
AC_MSG_WARN([Bison 3.0+ is not available: SQL disabled.])
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AM_CONDITIONAL(SQL, test x$sql = xtrue)
|
AM_CONDITIONAL(SQL, test x$sql = xtrue)
|
||||||
|
@ -106,7 +106,7 @@ char *g_strconcat(const char *first, ...) {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined _WIN32
|
#if defined _WIN32 && !defined(HAVE_VASPRINTF) && !defined(HAVE_VASNPRINTF)
|
||||||
int vasprintf(char **ret, const char *format, va_list ap) {
|
int vasprintf(char **ret, const char *format, va_list ap) {
|
||||||
int len;
|
int len;
|
||||||
int retval;
|
int retval;
|
||||||
@ -134,7 +134,7 @@ char *g_strdup_printf(const char *format, ...) {
|
|||||||
va_list argp;
|
va_list argp;
|
||||||
|
|
||||||
va_start(argp, format);
|
va_start(argp, format);
|
||||||
#ifdef __CYGWIN__
|
#ifdef HAVE_VASNPRINTF
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
ret = vasnprintf(ret, &len, format, argp);
|
ret = vasnprintf(ret, &len, format, argp);
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user