mdbtools/.github/workflows/build.yml
Evan Miller 0e3a627ee6
Make command-line arguments locale-aware (#237)
GLib will automatically convert command line options to UTF-8 provided that setlocale(LC_TYPE, "") is called first, and the argument type is STRING (but not FILENAME). Update the CLI tools to take advantage of this behavior, and likewise implement it in fakeglib.

GLib does not automatically convert non-option arguments (i.e. everything remaining in argv after option processing), so manually call g_locale_to_utf8 on these arguments when they represent table names. This should fix the CLI tools when processing non-ASCII table names in non-UTF-8 locales. Also update fakeglib to implement a fast and loose version of g_locale_to_utf8, and factor out some of the code page => iconv name logic in iconv.c so it can be used in our fake g_locale_to_utf8. This adds a new symbol mdb_iconv_name_from_code_page that is not advertised in the main header file. I did not want to include mdbtools.h from fakeglib.c, but maybe that's not important.
2021-01-14 17:34:50 -05:00

124 lines
3.9 KiB
YAML

name: build
on: [ push, pull_request ]
jobs:
linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
compiler: [ clang, gcc, gcc-8, gcc-9, gcc-10 ]
glib: [ enable-glib, disable-glib ]
steps:
- name: Install packages
run: sudo apt install gettext
- uses: actions/checkout@v2
- name: Fetch test data
run: git clone https://github.com/mdbtools/mdbtestdata.git test
- name: Autoconf
run: autoreconf -i -f
- name: Configure
run: ./configure --disable-silent-rules --${{ matrix.glib }} --with-unixodbc=/usr
env:
CC: ${{ matrix.compiler }}
- name: Make
run: make
- name: CLI tests
run: bash -e -x ./test_script.sh
- name: SQL tests
run: bash -e -x ./test_sql.sh
- name: ODBC tests
run: ./src/odbc/unittest
env:
MDBPATH: test/data
- name: pkg-config libmdb test
run: pkg-config libmdb --exists
env:
PKG_CONFIG_PATH: .
- name: pkg-config libmdbsql test
run: pkg-config libmdbsql --exists
env:
PKG_CONFIG_PATH: .
macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
compiler: [ clang, gcc ]
glib: [ enable-glib, disable-glib ]
steps:
- name: Install packages
run: brew install bison gawk automake
- uses: actions/checkout@v2
- name: Fetch test data
run: git clone https://github.com/mdbtools/mdbtestdata.git test
- name: Autoconf
run: autoreconf -i -f
- name: Configure
run: ./configure --disable-silent-rules --${{ matrix.glib }} --with-unixodbc=/usr/local/opt
env:
CC: ${{ matrix.compiler }}
YACC: /usr/local/opt/bison/bin/bison
- name: Make
run: make
- name: CLI tests
run: bash -e -x ./test_script.sh
- name: SQL tests
run: bash -e -x ./test_sql.sh
- name: ODBC tests
run: ./src/odbc/unittest
env:
MDBPATH: test/data
- name: pkg-config libmdb test
run: pkg-config libmdb --exists
env:
PKG_CONFIG_PATH: .
- name: pkg-config libmdbsql test
run: pkg-config libmdbsql --exists
env:
PKG_CONFIG_PATH: .
macos-iodbc:
runs-on: macos-latest
strategy:
matrix:
compiler: [ clang, gcc ]
glib: [ enable-glib, disable-glib ]
steps:
- name: Remove packages
run: brew unlink unixodbc
- name: Install packages
run: brew install libiodbc bison gawk automake
- uses: actions/checkout@v2
- name: Fetch test data
run: git clone https://github.com/mdbtools/mdbtestdata.git test
- name: Autoconf
run: autoreconf -i -f
- name: Configure
run: ./configure --disable-silent-rules --${{ matrix.glib }} --with-iodbc=/usr/local/opt
env:
CC: ${{ matrix.compiler }}
YACC: /usr/local/opt/bison/bin/bison
- name: Make
run: make
- name: ODBC tests
run: ./src/odbc/unittest
env:
MDBPATH: test/data
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" && bash -e -x ./test_script.sh'
- name: SQL Test
run: C:\msys64\usr\bin\bash -c -l 'cd "$GITHUB_WORKSPACE" && bash -e -x ./test_sql.sh'