aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/tests.yml
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2021-12-17 07:06:30 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2021-12-17 07:06:30 -0500
commit1fdc150116cad39aae5c5da407c3312b47a59e3a (patch)
tree123c79a4d7ad2d45781ba03ce939f7539fb428d8 /.github/workflows/tests.yml
parentfeda8a7db8d1d7c5439aa8f8feef7cc0dd2b59a0 (diff)
New upstream version 3.3.3+dfsg1.upstream/3.3.3+dfsg1
Diffstat (limited to '.github/workflows/tests.yml')
-rw-r--r--.github/workflows/tests.yml107
1 files changed, 107 insertions, 0 deletions
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
new file mode 100644
index 0000000..3453b57
--- /dev/null
+++ b/.github/workflows/tests.yml
@@ -0,0 +1,107 @@
+env:
+ TCL_VERSION: '8.6'
+ SQLITE_VERSION: '3350400'
+ SQLITE_RELEASE_YEAR: '2021'
+ PORTABLE_DIR: ${{ github.workspace }}/output/portable/SQLiteStudio
+
+name: Unit tests
+
+on:
+ push:
+ branches:
+ - master
+ - 3.2
+ - 3.3
+ paths:
+ - '**.cpp'
+ - '**.hpp'
+ - '**.c'
+ - '**.h'
+ - '**.pro'
+ - '**.pri'
+ - '**.ui'
+ - '**/tests.yml'
+
+jobs:
+ build:
+ runs-on: ubuntu-18.04
+
+ strategy:
+ matrix:
+ QT_VERSION: ['5.12.10', '5.15.2']
+
+ steps:
+ - name: Cache Qt
+ id: cache-qt
+ uses: actions/cache@v1
+ with:
+ path: ${{ github.workspace }}/../Qt
+ key: ${{ runner.os }}-Qt-${{ matrix.QT_VERSION }}-Linux-Cache
+
+ - name: Install Qt
+ uses: jurplel/install-qt-action@v2
+ with:
+ cached: ${{ steps.cache-qt.outputs.cache-hit }}
+ version: ${{ matrix.QT_VERSION }}
+ host: 'linux'
+ dir: '${{ github.workspace }}/..'
+ modules: 'qtscript'
+
+ - name: Clone repo
+ uses: actions/checkout@v2
+ with:
+ ref: ${{ env.GITHUB_REF }}
+
+ - name: Install SQLite3
+ run: |
+ sudo rm -f /usr/lib/libsqlite* /usr/local/lib/libsqlite* /usr/include/sqlite* /usr/local/include/sqlite* /usr/lib/x86_64-linux-gnu/libsqlite*
+ wget http://sqlite.org/$SQLITE_RELEASE_YEAR/sqlite-amalgamation-$SQLITE_VERSION.zip
+ unzip sqlite-amalgamation-$SQLITE_VERSION.zip
+ cd sqlite-amalgamation-$SQLITE_VERSION
+ gcc sqlite3.c -lpthread -ldl -lm -Os -fpic -shared -o libsqlite3.so \
+ -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT \
+ -DSQLITE_ENABLE_DBSTAT_VTAB \
+ -DSQLITE_ENABLE_BYTECODE_VTAB \
+ -DSQLITE_ENABLE_COLUMN_METADATA \
+ -DSQLITE_ENABLE_EXPLAIN_COMMENTS \
+ -DSQLITE_ENABLE_FTS3 \
+ -DSQLITE_ENABLE_FTS4 \
+ -DSQLITE_ENABLE_FTS5 \
+ -DSQLITE_ENABLE_GEOPOLY \
+ -DSQLITE_ENABLE_JSON1 \
+ -DSQLITE_ENABLE_RTREE \
+ -DSQLITE_ENABLE_MATH_FUNCTIONS
+ strip libsqlite3.so
+ sudo cp -P libsqlite3.so* /usr/local/lib/
+ sudo cp *.h /usr/local/include/
+
+ - name: Install Tcl
+ run: sudo apt-get install -qq libtcl$TCL_VERSION tcl$TCL_VERSION-dev
+
+ - name: Install other tools/dependencies
+ run: |
+ sudo apt install libreadline-dev libncurses5-dev
+ echo "${{ github.workspace }}/../Qt/${{ matrix.QT_VERSION }}/gcc_64/bin" >> $GITHUB_PATH
+
+ - name: Prepare output dir
+ run: mkdir output output/build output/build/Plugins
+
+ - name: Compile SQLiteStudio3
+ working-directory: output/build
+ run: |
+ qmake CONFIG+=portable CONFIG+=debug DEFINES+=tests ../../SQLiteStudio3
+ make -j 2
+
+ - name: Compile Plugins
+ working-directory: output/build/Plugins
+ run: |
+ qmake CONFIG+=portable CONFIG+=debug DEFINES+=tests ../../../Plugins
+ make -j 2
+
+ - name: Run tests
+ working-directory: output/SQLiteStudio
+ run: |
+ sudo cp -P /usr/local/lib/libsqlite3.so* ./lib/
+ export LD_LIBRARY_PATH="./lib"
+ ldd tst_tablemodifiertest
+ for f in tst_*; do ./$f; done