#91: Fix integration tests for Exasol v8 #20
This file contains 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: "Build and test Lua project" | |
on: [push] | |
jobs: | |
matrix-build: | |
strategy: | |
fail-fast: true | |
matrix: | |
lua_version: ["5.4"] | |
exasol_version: ["7.1.17"] # "8.18.1" is disabled because of failing tests, see https://github.com/exasol/exasol-driver-lua/issues/91 | |
env: | |
DEFAULT_DB_VERSION: "7.1.17" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-lua-${{ matrix.lua_version }}-exasol-${{ matrix.exasol_version }} | |
cancel-in-progress: true | |
name: "Build with Lua ${{ matrix.lua_version }} and Exasol ${{ matrix.exasol_version }}" | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Checkout integration test docker environment | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
repository: "exasol/integration-test-docker-environment" | |
path: "integration-test-docker-environment" | |
ref: "3.0.0" | |
- name: Cache local Luarocks repository | |
uses: actions/cache@v4 | |
with: | |
path: ~/.luarocks | |
key: ${{ runner.os }}-luarocks-${{ hashFiles('**/*.rockspec') }} | |
restore-keys: | | |
${{ runner.os }}-luarocks- | |
- name: Install Lua ${{ matrix.lua_version }} | |
uses: leafo/gh-actions-lua@v10 | |
with: | |
luaVersion: ${{ matrix.lua_version }} | |
- name: Install LuaRocks | |
uses: leafo/gh-actions-luarocks@v4 | |
with: | |
luaRocksVersion: "3.11.0" | |
- name: Print versions | |
run: | | |
lua -v | |
luarocks --version | |
luarocks path | |
- name: Install Lua dependencies | |
run: | | |
luarocks install --local --deps-only *.rockspec | |
luarocks install --local ldoc | |
- name: "Build" | |
run: luarocks make --local | |
- name: Run smoketests without database | |
run: | | |
eval $(luarocks path) | |
EXASOL_HOST=dummy LOG_LEVEL=TRACE luarocks test --local -- --run=smoketest | |
- name: Build API documentation | |
if: ${{ env.DEFAULT_DB_VERSION == matrix.exasol_version }} | |
run: ./tools/build-docs.sh | |
- name: Upload API documentation | |
if: ${{ env.DEFAULT_DB_VERSION == matrix.exasol_version }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: api-documentation | |
path: target/ldoc/ | |
if-no-files-found: error | |
- name: Spawn Exasol environment | |
id: spawn-test-environment | |
run: | | |
./start-test-env spawn-test-environment --environment-name test \ | |
--docker-db-image-version ${{ matrix.exasol_version }} \ | |
--database-port-forward 8563 | |
echo "itde-env=$GITHUB_WORKSPACE/integration-test-docker-environment/.build_output/cache/environments/test/environment_info.sh" >> "$GITHUB_OUTPUT" | |
working-directory: integration-test-docker-environment | |
- name: Verify Exasol environment configuration | |
run: | | |
cat $TEST_ENV_SH | |
env: | |
TEST_ENV_SH: ${{ steps.spawn-test-environment.outputs.itde-env }} | |
- name: Run example code | |
run: | | |
source $TEST_ENV_SH | |
eval $(luarocks path) | |
EXASOL_HOST=$ITDE_DATABASE_HOST \ | |
EXASOL_PORT=$ITDE_DATABASE_DB_PORT \ | |
EXASOL_USER=sys EXASOL_PASSWORD=exasol \ | |
lua doc/user_guide/examples.lua | |
env: | |
TEST_ENV_SH: ${{ steps.spawn-test-environment.outputs.itde-env }} | |
- name: Run integration tests | |
run: | | |
source $TEST_ENV_SH | |
eval $(luarocks path) | |
LOG_LEVEL=INFO \ | |
EXASOL_HOST=$ITDE_DATABASE_HOST \ | |
EXASOL_PORT=$ITDE_DATABASE_DB_PORT \ | |
EXASOL_USER=sys EXASOL_PASSWORD=exasol \ | |
tools/runtests.sh --run=ci | |
env: | |
TEST_ENV_SH: ${{ steps.spawn-test-environment.outputs.itde-env }} | |
- name: Archive code coverage results | |
if: ${{ env.DEFAULT_DB_VERSION == matrix.exasol_version }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: luacov-report | |
path: target/luacov-reports/* | |
- name: Validate tools | |
if: ${{ always() && env.DEFAULT_DB_VERSION == matrix.exasol_version }} | |
run: shellcheck --check-sourced --severity=style tools/*.sh | |
- name: Run static code analysis | |
if: ${{ always() && env.DEFAULT_DB_VERSION == matrix.exasol_version }} | |
run: | | |
eval $(luarocks path) | |
tools/runluacheck.sh | |
- name: Set up JDK for OpenFastTrace | |
if: ${{ env.DEFAULT_DB_VERSION == matrix.exasol_version }} | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: temurin | |
- name: Trace requirements | |
if: ${{ env.DEFAULT_DB_VERSION == matrix.exasol_version }} | |
run: ./tools/trace-requirements.sh | |
build: | |
needs: matrix-build | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo "Build finished" | |
## This is a separate job because it requires running apt-get which takes > 40s. | |
## When the other job also uses apt-get this can be moved back. | |
plantuml: | |
strategy: | |
fail-fast: true | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
name: "Build Plantuml diagrams" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Install Plantuml | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y plantuml | |
- name: Build diagrams | |
run: ./tools/build-diagrams.sh | |
# Checking if diagrams are up-to-date is not stable because | |
# different versions of PlantUML generate different images. |