1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
|
env:
TCL_VERSION: '8.6'
SQLITE_VERSION: '3490000'
PYTHON_VERSION: '3.9'
PORTABLE_DIR: ${{ github.workspace }}/output/portable/SQLiteStudio
name: Unit tests
on:
push:
branches:
- master
- 3.2
- 3.3
- 3.4
paths:
- '**.cpp'
- '**.hpp'
- '**.c'
- '**.h'
- '**.pro'
- '**.pri'
- '**.ui'
- '**.qrc'
- '**/tests.yml'
jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
QT_VERSION: ['5.15.2']
steps:
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: 'x64'
- name: Qt installation dir
id: qt-installation-dir
run: echo "DIR=$(readlink -f ${{ github.workspace }}/..)" >> $GITHUB_OUTPUT
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
cache: true
version: ${{ matrix.QT_VERSION }}
host: 'linux'
dir: '${{ steps.qt-installation-dir.DIR }}'
aqtversion: '==3.0.*'
py7zrversion: '==0.20.*'
setup-python: 'false'
extra: '--external 7z'
- name: Clone GH scripts
uses: actions/checkout@v3
with:
repository: pawelsalawa/gh-action-scripts
ref: main
path: gh-scripts
- name: Setup GH scripts path
shell: bash
run: |
mv gh-scripts ..
cd ..
chmod +x gh-scripts/scripts/*.sh
echo "GH_SCRIPTS=$(pwd)/gh-scripts/scripts" >> $GITHUB_ENV
echo "DEBUG=${{ inputs.DEBUG }}" >> $GITHUB_ENV
- name: Clone repo
uses: actions/checkout@v3
with:
ref: ${{ env.GITHUB_REF }}
- name: Install SQLite3
run: |
cd ..
SQLITE_DOT_VERSION=$($GH_SCRIPTS/convert_int_ver.sh $SQLITE_VERSION)
SQLITE3_ZIP=sqlite3-linux-x64-$SQLITE_VERSION.zip
curl -L https://github.com/pawelsalawa/sqlite3-sqls/releases/download/v$SQLITE_DOT_VERSION/$SQLITE3_ZIP --output $SQLITE3_ZIP
sudo rm -f /usr/lib/libsqlite* /usr/local/lib/libsqlite* /usr/include/sqlite* /usr/local/include/sqlite* /usr/lib/x86_64-linux-gnu/libsqlite*
sudo unzip $SQLITE3_ZIP libsqlite3.so -d /usr/local/lib
sudo unzip $SQLITE3_ZIP sqlite3.h sqlite3ext.h -d /usr/local/include
sudo ln -s /usr/local/lib/libsqlite3.so /usr/local/lib/libsqlite3.so.0
sudo ln -s /usr/local/lib/libsqlite3.so /usr/local/lib/libsqlite3.so.0.8.6
ls -l /usr/local/lib/libsqlite3*
ls -l /usr/local/include/sqlite*
- 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 "INCLUDEPATH+=$pythonLocation/include/python$PYTHON_VERSION" "LIBS += -L$pythonLocation/lib" ../../../Plugins
make -j 1
- 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
|