diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..16fe285 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,85 @@ +name: build +on: [ push, pull_request ] +jobs: + linux: + runs-on: ubuntu-latest + strategy: + 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: ./test_script.sh + - name: ODBC tests + run: env MDBPATH=test/data ./src/odbc/unittest + - name: pkg-config libmdb test + run: env PKG_CONFIG_PATH=. pkg-config libmdb --exists + - name: pkg-config libmdbsql test + run: env PKG_CONFIG_PATH=. pkg-config libmdbsql --exists + macos: + runs-on: macos-latest + strategy: + 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: ./test_script.sh + - name: ODBC tests + run: env MDBPATH=test/data ./src/odbc/unittest + - name: pkg-config libmdb test + run: env PKG_CONFIG_PATH=. pkg-config libmdb --exists + - name: pkg-config libmdbsql test + run: env PKG_CONFIG_PATH=. pkg-config libmdbsql --exists + 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: env MDBPATH=test/data ./src/odbc/unittest diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5b43f02..0000000 --- a/.travis.yml +++ /dev/null @@ -1,190 +0,0 @@ -language: c -dist: bionic - -jobs: - include: - - compiler: clang - os: linux - addons: - apt: - packages: - - libiodbc2-dev - - gawk - env: - - CONFIGURE_FLAGS="--with-iodbc=/usr --disable-glib" - - compiler: clang - os: linux - addons: - apt: - packages: - - libiodbc2-dev - - libglib2.0-dev - - gawk - env: - - CONFIGURE_FLAGS="--with-iodbc=/usr --enable-glib" - - compiler: clang - os: linux - addons: - apt: - packages: - - unixodbc-dev - - gawk - env: - - CONFIGURE_FLAGS="--with-unixodbc=/usr --disable-glib" - - compiler: clang - os: linux - addons: - apt: - packages: - - unixodbc-dev - - libglib2.0-dev - - gawk - env: - - CONFIGURE_FLAGS="--with-unixodbc=/usr --enable-glib" - - compiler: gcc - os: linux - addons: - apt: - packages: - - libiodbc2-dev - - gawk - env: - - CONFIGURE_FLAGS="--with-iodbc=/usr --disable-glib" - - compiler: gcc - os: linux - addons: - apt: - packages: - - unixodbc-dev - - gawk - env: - - CONFIGURE_FLAGS="--with-unixodbc=/usr --disable-glib" - - compiler: gcc-10 - os: linux - addons: - apt: - sources: - - sourceline: 'ppa:ubuntu-toolchain-r/test' - packages: - - gcc-10 - - libiodbc2-dev - - gawk - env: - - CONFIGURE_FLAGS="--with-iodbc=/usr --disable-glib" - - compiler: gcc-10 - os: linux - addons: - apt: - sources: - - sourceline: 'ppa:ubuntu-toolchain-r/test' - packages: - - gcc-10 - - unixodbc-dev - - gawk - env: - - CONFIGURE_FLAGS="--with-unixodbc=/usr --disable-glib" - - compiler: clang - os: osx - osx_image: xcode11.4 - addons: - homebrew: - packages: - - libiodbc - - bison - - gawk - - pkg-config - env: - - CONFIGURE_FLAGS="--with-iodbc=/usr/local/opt --disable-glib" - - YACC="/usr/local/opt/bison/bin/bison" - - compiler: clang - os: osx - osx_image: xcode11.4 - addons: - homebrew: - packages: - - libiodbc - - glib - - bison - - gawk - - pkg-config - env: - - CONFIGURE_FLAGS="--with-iodbc=/usr/local/opt --enable-glib" - - YACC="/usr/local/opt/bison/bin/bison" - - compiler: clang - os: osx - osx_image: xcode11.4 - addons: - homebrew: - packages: - - unixodbc - - bison - - gawk - - pkg-config - env: - - CONFIGURE_FLAGS="--with-unixodbc=/usr/local/opt --disable-glib" - - YACC="/usr/local/opt/bison/bin/bison" - - compiler: clang - os: osx - osx_image: xcode11.4 - addons: - homebrew: - packages: - - unixodbc - - glib - - bison - - gawk - - pkg-config - env: - - CONFIGURE_FLAGS="--with-unixodbc=/usr/local/opt --enable-glib" - - YACC="/usr/local/opt/bison/bin/bison" - - compiler: gcc - os: osx - osx_image: xcode11.4 - addons: - homebrew: - packages: - - libiodbc - - bison - - gawk - - pkg-config - env: - - CONFIGURE_FLAGS="--with-iodbc=/usr/local/opt --disable-glib" - - YACC="/usr/local/opt/bison/bin/bison" - - compiler: gcc - os: osx - osx_image: xcode11.4 - addons: - homebrew: - packages: - - unixodbc - - bison - - gawk - - pkg-config - env: - - CONFIGURE_FLAGS="--with-unixodbc=/usr/local/opt --disable-glib" - - YACC="/usr/local/opt/bison/bin/bison" - -before_script: - - git clone https://github.com/mdbtools/mdbtestdata.git test - - autoreconf -i -f - -script: - - ./configure --disable-silent-rules $CONFIGURE_FLAGS - - make - - ./src/util/mdb-json test/data/ASampleDatabase.accdb "Asset Items" - - ./src/util/mdb-json test/data/nwind.mdb "Customers" - - ./src/util/mdb-count test/data/ASampleDatabase.accdb "Asset Items" - - ./src/util/mdb-count test/data/nwind.mdb "Customers" - - ./src/util/mdb-prop test/data/ASampleDatabase.accdb "Asset Items" - - ./src/util/mdb-prop test/data/nwind.mdb "Customers" - - ./src/util/mdb-schema test/data/ASampleDatabase.accdb - - ./src/util/mdb-schema test/data/nwind.mdb - - ./src/util/mdb-tables test/data/ASampleDatabase.accdb - - ./src/util/mdb-tables test/data/nwind.mdb - - ./src/util/mdb-ver test/data/ASampleDatabase.accdb - - ./src/util/mdb-ver test/data/nwind.mdb - - ./src/util/mdb-sql -i test/sql/nwind.sql test/data/nwind.mdb - - ./src/util/mdb-queries test/data/ASampleDatabase.accdb qryCostsSummedByOwner - - env MDBPATH=test/data ./src/odbc/unittest - - env PKG_CONFIG_PATH=. pkg-config libmdb --exists - - env PKG_CONFIG_PATH=. pkg-config libmdbsql --exists diff --git a/README.md b/README.md index 0306974..3f7198c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/mdbtools/mdbtools.svg?branch=dev)](https://travis-ci.org/mdbtools/mdbtools) +[![Build Status](https://github.com/mdbtools/mdbtools/workflows/build/badge.svg)](https://githubs.com/mdbtools/mdbtools/actions) [![Build status](https://ci.appveyor.com/api/projects/status/22wwy5d0rrmk6e3c/branch/dev?svg=true)](https://ci.appveyor.com/project/evanmiller/mdbtools/branch/dev) Welcome to the exciting world of MDB Tools! MDB Tools is a set of programs to diff --git a/appveyor.yml b/appveyor.yml index 0e27714..5d73be3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -42,19 +42,9 @@ test_script: if ($env:TOOLCHAIN -eq "msys2") { $env:MSYSTEM="MINGW64" - C:\msys64\usr\bin\bash -l -c "cd /c/projects/mdbtools && ./src/util/mdb-ver ./test/data/ASampleDatabase.accdb" - C:\msys64\usr\bin\bash -l -c "cd /c/projects/mdbtools && ./src/util/mdb-ver ./test/data/nwind.mdb" - C:\msys64\usr\bin\bash -l -c "cd /c/projects/mdbtools && ./src/util/mdb-tables ./test/data/ASampleDatabase.accdb" - C:\msys64\usr\bin\bash -l -c "cd /c/projects/mdbtools && ./src/util/mdb-tables ./test/data/nwind.mdb" - C:\msys64\usr\bin\bash -l -c "cd /c/projects/mdbtools && ./src/util/mdb-count ./test/data/ASampleDatabase.accdb 'Asset Items'" - C:\msys64\usr\bin\bash -l -c "cd /c/projects/mdbtools && ./src/util/mdb-count ./test/data/nwind.mdb Customers" + C:\msys64\usr\bin\bash -l -c "cd /c/projects/mdbtools && ./test_script.sh" } else { - C:\cygwin64\bin\sh -lc "cd /cygdrive/c/projects/mdbtools && ./src/util/mdb-ver ./test/data/ASampleDatabase.accdb" - C:\cygwin64\bin\sh -lc "cd /cygdrive/c/projects/mdbtools && ./src/util/mdb-ver ./test/data/nwind.mdb" - C:\cygwin64\bin\sh -lc "cd /cygdrive/c/projects/mdbtools && ./src/util/mdb-tables ./test/data/ASampleDatabase.accdb" - C:\cygwin64\bin\sh -lc "cd /cygdrive/c/projects/mdbtools && ./src/util/mdb-tables ./test/data/nwind.mdb" - C:\cygwin64\bin\sh -lc "cd /cygdrive/c/projects/mdbtools && ./src/util/mdb-count ./test/data/ASampleDatabase.accdb 'Asset Items'" - C:\cygwin64\bin\sh -lc "cd /cygdrive/c/projects/mdbtools && ./src/util/mdb-count ./test/data/nwind.mdb Customers" + C:\cygwin64\bin\sh -lc "cd /cygdrive/c/projects/mdbtools && ./test_script.sh" } diff --git a/test_script.sh b/test_script.sh new file mode 100755 index 0000000..240a7a5 --- /dev/null +++ b/test_script.sh @@ -0,0 +1,18 @@ +#!/bin/bash -x + +# Simple test script; run after performing +# git clone https://github.com/mdbtools/mdbtestdata.git test +./src/util/mdb-json test/data/ASampleDatabase.accdb "Asset Items" +./src/util/mdb-json test/data/nwind.mdb "Customers" +./src/util/mdb-count test/data/ASampleDatabase.accdb "Asset Items" +./src/util/mdb-count test/data/nwind.mdb "Customers" +./src/util/mdb-prop test/data/ASampleDatabase.accdb "Asset Items" +./src/util/mdb-prop test/data/nwind.mdb "Customers" +./src/util/mdb-schema test/data/ASampleDatabase.accdb +./src/util/mdb-schema test/data/nwind.mdb +./src/util/mdb-tables test/data/ASampleDatabase.accdb +./src/util/mdb-tables test/data/nwind.mdb +./src/util/mdb-ver test/data/ASampleDatabase.accdb +./src/util/mdb-ver test/data/nwind.mdb +./src/util/mdb-sql -i test/sql/nwind.sql test/data/nwind.mdb +./src/util/mdb-queries test/data/ASampleDatabase.accdb qryCostsSummedByOwner