Skip to content

Quote new references to the Groups table for MySQL 8 #547

Quote new references to the Groups table for MySQL 8

Quote new references to the Groups table for MySQL 8 #547

Workflow file for this run

on:
push:
branches-ignore:
- 'maint'
- 'stable'
jobs:
rt_test_sqlite:
runs-on: ubuntu-latest
steps:
- name: Set up for tests
shell: bash
run: |
echo "RT_BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
echo "RT_GA_START_TIME=$(date +%s)" >> $GITHUB_ENV
echo "DOCKER_BUILDKIT=0" >> $GITHUB_ENV
- name: Check out RT
uses: actions/checkout@v2
- name: Cache .prove state
id: cache-prove-state
uses: actions/cache@v3
with:
path: .prove
key: ${{ runner.os }}-sqlite
- name: Build RT
shell: bash
run: |
docker build -t rt-base .
docker run -d -v $GITHUB_WORKSPACE:/rt --name rt rt-base
docker exec rt bash -c "cd /rt && ./configure.ac --with-db-type=SQLite --with-my-user-group --enable-layout=inplace --enable-developer --enable-externalauth --enable-gpg --enable-smime && mkdir -p /rt/var && make testdeps"
- name: Run RT tests
shell: bash
run: docker exec rt bash -c "cd /rt && prove -l t/api/rights_inspector.t"
- name: Get run time
# Default is success(), we want to always() get the time
if: always()
shell: bash
run: |
export RT_GA_END_TIME=$(date +%s)
echo RT_GA_START_TIME ${{ env.RT_GA_START_TIME }}
echo RT_GA_END_TIME $RT_GA_END_TIME
echo "RT_GA_END_TIME=$RT_GA_END_TIME" >> $GITHUB_ENV
export RT_GA_TEST_TIME=$(( RT_GA_END_TIME - ${{ env.RT_GA_START_TIME }} ))
# Convert seconds to HH::MM::SS
export RT_GA_TEST_TIME=$(date -u -d @"$RT_GA_TEST_TIME" +"%T")
echo "RT_GA_TEST_TIME=$RT_GA_TEST_TIME" >> $GITHUB_ENV
- name: Post results to Slack
if: ${{ always() && github.repository_owner == 'bestpractical' }}
uses: edge/[email protected]
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFICATIONS }}
with:
channel: '#github'
status: ${{ job.status }}
success_text: '${env.RT_BRANCH_NAME} (${env.GITHUB_RUN_NUMBER}) tests completed successfully in ${env.RT_GA_TEST_TIME}'
failure_text: '${env.RT_BRANCH_NAME} (${env.GITHUB_RUN_NUMBER}) tests failed in ${env.RT_GA_TEST_TIME}'
cancelled_text: '${env.RT_BRANCH_NAME} (${env.GITHUB_RUN_NUMBER}) tests cancelled in ${env.RT_GA_TEST_TIME}'
fields: |
[{ "title": "Configuration", "value": "RT Server, SQLite", "short": true },
{ "title": "URL", "value": "${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}?check_suite_focus=true", "short": true }]
rt_test_mysql8:
runs-on: ubuntu-latest
steps:
- name: Set up for tests
shell: bash
run: |
echo "RT_BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
echo "RT_GA_START_TIME=$(date +%s)" >> $GITHUB_ENV
echo "DOCKER_BUILDKIT=0" >> $GITHUB_ENV
- name: Checkout RT
uses: actions/checkout@v2
- name: Cache .prove state
id: cache-prove-state
uses: actions/cache@v3
with:
path: .prove
key: ${{ runner.os }}-mysql8
- name: Build RT
shell: bash
run: |
docker network create rt
docker run --network rt --name mysql -e MYSQL_ROOT_PASSWORD=password -d mysql:8.0 --default-authentication-plugin=mysql_native_password
docker build --network rt -t rt-base .
docker run -d -v $GITHUB_WORKSPACE:/rt --name rt --env RT_TEST_DB_HOST=mysql --env RT_TEST_RT_HOST=172.16.0.0/255.240.0.0 --network rt --name rt rt-base
docker exec rt bash -c "cd /rt && ./configure.ac --with-db-type=mysql --with-my-user-group --enable-layout=inplace --enable-developer --enable-externalauth --enable-gpg --enable-smime && mkdir -p /rt/var && make testdeps"
- name: Run RT tests
shell: bash
run: docker exec rt bash -c "cd /rt && prove -l t/api/rights_inspector.t"
- name: Get run time
if: always()
shell: bash
run: |
export RT_GA_END_TIME=$(date +%s)
echo RT_GA_START_TIME ${{ env.RT_GA_START_TIME }}
echo RT_GA_END_TIME $RT_GA_END_TIME
echo "RT_GA_END_TIME=$RT_GA_END_TIME" >> $GITHUB_ENV
export RT_GA_TEST_TIME=$(( RT_GA_END_TIME - ${{ env.RT_GA_START_TIME }} ))
# Convert seconds to HH::MM::SS
export RT_GA_TEST_TIME=$(date -u -d @"$RT_GA_TEST_TIME" +"%T")
echo "RT_GA_TEST_TIME=$RT_GA_TEST_TIME" >> $GITHUB_ENV
- name: Post results to Slack
if: ${{ always() && github.repository_owner == 'bestpractical' }}
uses: edge/[email protected]
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFICATIONS }}
with:
channel: '#github'
status: ${{ job.status }}
success_text: '${env.RT_BRANCH_NAME} (${env.GITHUB_RUN_NUMBER}) tests completed successfully in ${env.RT_GA_TEST_TIME}'
failure_text: '${env.RT_BRANCH_NAME} (${env.GITHUB_RUN_NUMBER}) tests failed in ${env.RT_GA_TEST_TIME}'
cancelled_text: '${env.RT_BRANCH_NAME} (${env.GITHUB_RUN_NUMBER}) tests cancelled in ${env.RT_GA_TEST_TIME}'
fields: |
[{ "title": "Configuration", "value": "RT Server, MySQL 8.0", "short": true },
{ "title": "URL", "value": "${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}?check_suite_focus=true", "short": true }]