fix(ci): libaio.so.1 symlink for Oracle Instant Client (24.04 t64 ren… #45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| LUA_PATH: "./?.lua;./?/init.lua;;" | |
| jobs: | |
| lint: | |
| name: lint (luacheck) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: leafo/gh-actions-lua@v13 | |
| with: | |
| luaVersion: "5.4" | |
| - uses: leafo/gh-actions-luarocks@v4 | |
| - run: luarocks install luacheck | |
| - run: luacheck lua_SQLBuilder spec | |
| unit: | |
| name: unit (Lua ${{ matrix.lua }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| lua: ["5.1", "5.2", "5.3", "5.4", "luajit-2.1"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: leafo/gh-actions-lua@v13 | |
| with: | |
| luaVersion: ${{ matrix.lua }} | |
| - uses: leafo/gh-actions-luarocks@v4 | |
| - name: Run unit specs (pure SQL generation, no DB) | |
| run: | | |
| if [ "${{ matrix.lua }}" = "luajit-2.1" ]; then | |
| # LuaJIT cannot load luarocks' large manifests (>65536 constants); | |
| # the zero-dependency runner needs no rocks at all. | |
| lua spec/run.lua spec/unit spec/audit spec/production | |
| else | |
| luarocks install busted | |
| busted --helper=spec/helpers/init.lua spec/unit spec/audit spec/production | |
| fi | |
| integration-sqlite: | |
| name: sqlite integration (Lua ${{ matrix.lua }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| lua: ["5.1", "5.2", "5.3", "5.4"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: leafo/gh-actions-lua@v13 | |
| with: | |
| luaVersion: ${{ matrix.lua }} | |
| - uses: leafo/gh-actions-luarocks@v4 | |
| - run: luarocks install busted | |
| - name: Install sqlite driver | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libsqlite3-dev | |
| luarocks install lsqlite3 | |
| - name: Run integration specs against in-process SQLite | |
| run: busted --helper=spec/helpers/init.lua spec/integration | |
| env: | |
| LUA_SQLBUILDER_DB: sqlite | |
| integration-duckdb: | |
| name: duckdb integration (Lua ${{ matrix.lua }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| lua: ["5.1", "5.2", "5.3", "5.4"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: leafo/gh-actions-lua@v13 | |
| with: | |
| luaVersion: ${{ matrix.lua }} | |
| - uses: leafo/gh-actions-luarocks@v4 | |
| - run: luarocks install busted | |
| - name: Install duckdb prebuilt lib (official release asset) | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y wget unzip build-essential | |
| cd /tmp | |
| wget -q https://github.com/duckdb/duckdb/releases/download/v1.5.5/libduckdb-linux-amd64.zip | |
| mkdir -p /tmp/duckdb-lib && cd /tmp/duckdb-lib | |
| unzip -o ../libduckdb-linux-amd64.zip | |
| ls -la | |
| # luasql-duckdb expects DUCKDB_DIR/include + DUCKDB_DIR/lib | |
| sudo mkdir -p /opt/duckdb/include /opt/duckdb/lib | |
| sudo cp duckdb.h /opt/duckdb/include/ | |
| sudo cp libduckdb.so /opt/duckdb/lib/ | |
| sudo sh -c 'echo /opt/duckdb/lib > /etc/ld.so.conf.d/duckdb.conf' | |
| sudo ldconfig | |
| luarocks install luasql-duckdb DUCKDB_DIR=/opt/duckdb | |
| - name: Run integration specs against in-process DuckDB | |
| run: busted --helper=spec/helpers/init.lua spec/integration | |
| env: | |
| LUA_SQLBUILDER_DB: duckdb | |
| integration-clickhouse: | |
| name: clickhouse integration (Lua ${{ matrix.lua }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| lua: ["5.1", "5.4"] | |
| services: | |
| clickhouse: | |
| image: clickhouse/clickhouse-server:24.8 | |
| env: | |
| CLICKHOUSE_PASSWORD: clickhouse | |
| ports: ["8123:8123"] | |
| options: >- | |
| --health-cmd="clickhouse-client --password clickhouse --query 'SELECT 1'" | |
| --health-interval=5s | |
| --health-timeout=5s | |
| --health-retries=20 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: leafo/gh-actions-lua@v13 | |
| with: | |
| luaVersion: ${{ matrix.lua }} | |
| - uses: leafo/gh-actions-luarocks@v4 | |
| - run: luarocks install busted | |
| - name: Install clickhouse HTTP deps (luasocket + cjson) | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libssl-dev | |
| luarocks install luasocket | |
| luarocks install lua-cjson | |
| - name: Diagnose clickhouse reachability | |
| run: | | |
| curl -s -u default:clickhouse --data "SELECT 1" http://127.0.0.1:8123/ || echo "curl failed" | |
| - name: Run integration specs against ClickHouse over HTTP | |
| run: busted --helper=spec/helpers/init.lua spec/integration | |
| env: | |
| LUA_SQLBUILDER_DB: clickhouse | |
| CLICKHOUSE_HOST: 127.0.0.1 | |
| CLICKHOUSE_PORT: "8123" | |
| integration-oracle: | |
| name: oracle integration (Lua ${{ matrix.lua }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| lua: ["5.4"] | |
| services: | |
| oracle: | |
| image: gvenzl/oracle-free:23-slim | |
| env: | |
| ORACLE_PASSWORD: app | |
| APP_USER: app | |
| APP_USER_PASSWORD: app | |
| ports: ["1521:1521"] | |
| options: >- | |
| --health-cmd="healthcheck.sh" | |
| --health-interval=10s | |
| --health-timeout=10s | |
| --health-retries=30 | |
| --health-start-period=60s | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: leafo/gh-actions-lua@v13 | |
| with: | |
| luaVersion: ${{ matrix.lua }} | |
| - uses: leafo/gh-actions-luarocks@v4 | |
| - run: luarocks install busted | |
| - name: Install Oracle Instant Client + luasql-oci8 (best-effort) | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y wget unzip libaio1t64 libnsl2 | |
| # Ubuntu 24.04 t64 rename: Oracle Instant Client needs libaio.so.1 | |
| sudo ln -sf /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/x86_64-linux-gnu/libaio.so.1 | |
| sudo mkdir -p /opt/oracle/instantclient | |
| cd /opt/oracle/instantclient | |
| wget https://download.oracle.com/otn_software/linux/instantclient/2114000/instantclient-basiclite-linux.x64-21.14.0.0.0dbru.zip || echo "basiclite download failed" | |
| wget https://download.oracle.com/otn_software/linux/instantclient/2114000/instantclient-sdk-linux.x64-21.14.0.0.0dbru.zip || echo "sdk download failed" | |
| ls -la *.zip || echo "no zip files" | |
| for z in *.zip; do [ -f "$z" ] && sudo unzip -o "$z"; done | |
| IC_DIR=$(ls -d /opt/oracle/instantclient/instantclient_* 2>/dev/null | head -1) | |
| echo "IC_DIR=$IC_DIR" | |
| if [ -n "$IC_DIR" ] && [ -f "$IC_DIR/sdk/include/oci.h" ]; then | |
| sudo sh -c "echo $IC_DIR > /etc/ld.so.conf.d/oracle.conf" | |
| sudo ldconfig | |
| luarocks install luasql-oci8 \ | |
| OCI8_INCDIR="$IC_DIR/sdk/include" \ | |
| OCI8_LIBDIR="$IC_DIR" || echo "luasql-oci8 build failed" | |
| else | |
| echo "OCI SDK headers missing (dir=$IC_DIR)" | |
| ls -la "$IC_DIR" 2>/dev/null | head -8 || echo "no instantclient dir" | |
| fi | |
| - name: Run integration specs against Oracle | |
| run: | | |
| lua -e "local ok, err = pcall(require, 'luasql.oci8'); print('oci8 require:', ok, err)" | |
| busted --helper=spec/helpers/init.lua spec/integration | |
| env: | |
| LD_LIBRARY_PATH: /opt/oracle/instantclient/instantclient_21_14 | |
| LUA_SQLBUILDER_DB: oracle | |
| ORACLE_USER: app | |
| ORACLE_PASSWORD: app | |
| ORACLE_HOST: 127.0.0.1 | |
| ORACLE_PORT: "1521" | |
| ORACLE_SERVICE: FREEPDB1 | |
| integration-servers: | |
| name: ${{ matrix.db }} integration (Lua ${{ matrix.lua }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| lua: ["5.1", "5.2", "5.3", "5.4"] | |
| db: [mysql, postgres] | |
| services: | |
| mysql: | |
| image: mysql:8.0 | |
| env: | |
| MYSQL_ROOT_PASSWORD: root | |
| MYSQL_DATABASE: sqlbuilder_test | |
| ports: ["3306:3306"] | |
| options: >- | |
| --health-cmd="mysqladmin ping -h 127.0.0.1 -uroot -proot" | |
| --health-interval=5s | |
| --health-timeout=5s | |
| --health-retries=20 | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: sqlbuilder_test | |
| # trust auth: no crypto needed. pgmoon's md5 AND scram both require | |
| # luaossl/LuaCrypto (openssl); luaossl does not build on OpenSSL 3. | |
| # Server-side scram-stored passwords force SCRAM even with md5 in | |
| # pg_hba, so trust is the only zero-crypto option for CI. | |
| POSTGRES_HOST_AUTH_METHOD: trust | |
| ports: ["5432:5432"] | |
| options: >- | |
| --health-cmd="pg_isready -U postgres -h 127.0.0.1" | |
| --health-interval=5s | |
| --health-timeout=5s | |
| --health-retries=20 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: leafo/gh-actions-lua@v13 | |
| with: | |
| luaVersion: ${{ matrix.lua }} | |
| - uses: leafo/gh-actions-luarocks@v4 | |
| - run: luarocks install busted | |
| - name: Install DB drivers | |
| run: | | |
| sudo apt-get update | |
| if [ "${{ matrix.db }}" = "mysql" ]; then | |
| sudo apt-get install -y libmysqlclient-dev | |
| luarocks install luasql-mysql MYSQL_INCDIR=/usr/include/mysql MYSQL_LIBDIR=/usr/lib/x86_64-linux-gnu | |
| else | |
| # pgmoon is pure Lua; trust auth needs no crypto rock | |
| # (luaossl does not build against OpenSSL 3) | |
| sudo apt-get install -y libssl-dev | |
| luarocks install luasocket | |
| luarocks install lua-cjson | |
| luarocks install pgmoon | |
| fi | |
| - name: Run integration specs against ${{ matrix.db }} | |
| run: busted --helper=spec/helpers/init.lua spec/integration | |
| env: | |
| LUA_SQLBUILDER_DB: ${{ matrix.db }} | |
| MYSQL_HOST: 127.0.0.1 | |
| MYSQL_PORT: "3306" | |
| MYSQL_USER: root | |
| MYSQL_PASSWORD: root | |
| MYSQL_DATABASE: sqlbuilder_test | |
| POSTGRES_HOST: 127.0.0.1 | |
| POSTGRES_PORT: "5432" | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DATABASE: sqlbuilder_test |