Update SQLancer checkout step to use official repository and correct … #14
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: Run sqlancer tests | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| citus_release: | |
| description: 'Branch, tag or SHA to run tests against' | |
| required: true | |
| default: 'release-13.1' | |
| push: | |
| branches: | |
| - m3hm3t/sqllancer | |
| jobs: | |
| run-sqlancer-test-on-citus: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/citusdata/exttester:17.5-dev-aa7482a | |
| options: --user root | |
| steps: | |
| - name: Checkout Citus | |
| uses: actions/checkout@v3 | |
| with: | |
| repository: citusdata/citus | |
| ref: ${{ inputs.citus_release }} | |
| - name: Configure & Build Citus | |
| run: | | |
| ./configure 2>&1 | tee output.log | |
| make install-all -sj$(nproc) 2>&1 | tee -a output.log | |
| - name: Install Java & Maven | |
| run: | | |
| apt-get update | |
| apt-get install -y openjdk-11-jdk maven | |
| - name: Checkout SQLancer (official fork) | |
| uses: actions/checkout@v3 | |
| with: | |
| repository: gokhangulbiz/sqlancer | |
| ref: citus_v12_support | |
| path: sqlancer | |
| - name: Cache Maven | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-m2-${{ hashFiles('**/sqlancer/pom.xml') }} | |
| restore-keys: ${{ runner.os }}-m2- | |
| - name: Build SQLancer | |
| working-directory: sqlancer | |
| run: mvn -B package -DskipTests | |
| - name: Initialize Citus cluster | |
| run: | | |
| mkdir -p citus/coordinator citus/worker1 citus/worker2 | |
| chown -R circleci:circleci citus | |
| gosu circleci initdb -D citus/coordinator | |
| gosu circleci initdb -D citus/worker1 | |
| gosu circleci initdb -D citus/worker2 | |
| gosu circleci echo "shared_preload_libraries = 'citus'" >> citus/coordinator/postgresql.conf | |
| gosu circleci echo "shared_preload_libraries = 'citus'" >> citus/worker1/postgresql.conf | |
| gosu circleci echo "shared_preload_libraries = 'citus'" >> citus/worker2/postgresql.conf | |
| gosu circleci pg_ctl -D citus/coordinator -o "-p 9700" -l citus/coordinator_logfile start | |
| gosu circleci pg_ctl -D citus/worker1 -o "-p 9701" -l citus/worker1_logfile start | |
| gosu circleci ls citus/worker1 | |
| gosu circleci pg_ctl -D citus/worker2 -o "-p 9702" -l citus/worker2_logfile start | |
| gosu circleci psql -c "CREATE ROLE sqlancer SUPERUSER LOGIN CREATEDB PASSWORD 'sqlancer';" -p 9700 -d postgres | |
| gosu circleci createdb test -p 9700 | |
| gosu circleci psql -c "CREATE ROLE sqlancer SUPERUSER LOGIN CREATEDB PASSWORD 'sqlancer';" -p 9701 -d postgres | |
| gosu circleci createdb test -p 9701 | |
| gosu circleci psql -c "CREATE ROLE sqlancer SUPERUSER LOGIN CREATEDB PASSWORD 'sqlancer';" -p 9702 -d postgres | |
| gosu circleci createdb test -p 9702 | |
| gosu circleci psql -c "CREATE EXTENSION citus;" -p 9700 -d test | |
| gosu circleci psql -c "CREATE EXTENSION citus;" -p 9701 -d test | |
| gosu circleci psql -c "CREATE EXTENSION citus;" -p 9702 -d test | |
| gosu circleci psql -c "SELECT * from citus_add_node('localhost', 9701);" -p 9700 -d test | |
| gosu circleci psql -c "SELECT * from citus_add_node('localhost', 9702);" -p 9700 -d test | |
| - name: Run SQLancer tests | |
| working-directory: sqlancer | |
| env: | |
| CITUS_AVAILABLE: true | |
| run: mvn -Dtest=TestCitus test | |
| - name: Publish Logs | |
| if: ${{ always() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: citus-logs | |
| path: | | |
| citus/*.{log,logfile} | |
| logs | |
| - name: Publish Summary | |
| if: ${{ always() }} | |
| run: | | |
| grep -R "ERROR:.*" citus \ | |
| | awk -F: '{ errs[$4] = errs[$4] ? errs[$4] ", " $1 : $1 } | |
| END { for (e in errs) { | |
| print "### " e >> ENVIRON["GITHUB_STEP_SUMMARY"] | |
| print "In: " errs[e] >> ENVIRON["GITHUB_STEP_SUMMARY"] | |
| } }' | |
| shell: bash |