24_1 CI updates #16
Workflow file for this run
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: CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up MySQL server | |
run: | | |
docker run -d -p 3306:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=yes --name test-mysql mysql:8.0 | |
echo "MySQL startup ..." | |
until docker exec test-mysql mysql -u root -e "SELECT 1;"; do \ | |
echo "..."; \ | |
sleep 1; \ | |
done; | |
docker exec -u root test-mysql mysql -u root -e "CREATE DATABASE testdb;" | |
docker exec -u root test-mysql mysql -u root testdb -e "CREATE TABLE test_source (i integer, b boolean, f float, v varchar(32), c char(32), lv varchar(9999), bn binary(32), vb varbinary(32), lvb varbinary(9999), d date, t time, ts timestamp null, tz varchar(80), tsz varchar(80), n numeric(20,4));" | |
docker exec -u root test-mysql /bin/bash -c "(echo \"INSERT INTO test_source VALUES (null, null, null, null, null, null, null, null, null, null, null, null, null, null, null);\"; for i in \`seq 1 9\`; do echo \"INSERT INTO test_source VALUES (\$i, 1, \$i.5, 'test \$i', 'test \$i', 'test \$i', 'test \$i', 'test \$i', 'test \$i', '\$((\$i+11))00/1/\$i', '4:0\$i', '2038-01-0\$i 03:14:07', '1:2\$i:00', 'June 1, \$((\$i+11))00 03:2\$i EST', '123456.7890');\"; done) | mysql -u root testdb" | |
docker exec -u root test-mysql mysql -u root testdb -e "select * from test_source;" | |
- name: Set up a Vertica server | |
timeout-minutes: 15 | |
run: | | |
docker run -d -p 5433:5433 -p 5444:5444 \ | |
-e ODBCSYSINI=/var/odbc-loader/tests/config \ | |
--add-host=host.docker.internal:host-gateway \ | |
--name vertica_docker \ | |
vertica/vertica-ce:24.1.0-0 | |
echo "Vertica startup ..." | |
until docker exec vertica_docker test -f /data/vertica/VMart/agent_start.out; do \ | |
echo "..."; \ | |
sleep 3; \ | |
done; | |
echo "Vertica is up" | |
docker exec -u dbadmin vertica_docker /opt/vertica/bin/vsql -c "\l" | |
docker exec -u dbadmin vertica_docker /opt/vertica/bin/vsql -c "select version()" | |
- name: Build & Install UDx | |
run: | | |
docker exec -u root vertica_docker dnf -y install gcc-toolset-9-gcc-c++.x86_64 | |
docker exec -u root vertica_docker dnf -y install unixODBC-devel | |
docker exec -u root vertica_docker dnf -y install pcre-devel | |
docker exec -u root vertica_docker dnf -y install perl | |
docker cp ${{ github.workspace }} vertica_docker:/var/odbc-loader | |
docker exec -u root vertica_docker /bin/bash -c "sudo chown -R dbadmin:verticadba /var/odbc-loader" | |
docker exec -u root -w /var/odbc-loader vertica_docker dnf install -y make | |
docker exec -u dbadmin -w /var/odbc-loader vertica_docker scl enable gcc-toolset-9 "bash -c 'make; make install'" | |
- name: Install ODBC clients | |
run: | | |
docker exec -w /var/odbc-loader -u root vertica_docker wget https://downloads.mysql.com/archives/get/p/10/file/mysql-connector-odbc-8.2.0-1.el7.src.rpm | |
docker exec -w /var/odbc-loader -u root vertica_docker rpm -i mysql-connector-odbc-8.2.0-1.el7.src.rpm | |
- name: Run Tests | |
run: | | |
docker exec -w /var/odbc-loader -u dbadmin vertica_docker make test |