Skip to content

feat: adfs authentication support (#214) #154

feat: adfs authentication support (#214)

feat: adfs authentication support (#214) #154

Workflow file for this run

name: Integration Tests
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- '*'
paths-ignore:
- '**/*.md'
- '**/*.jpg'
- '**/README.txt'
- '**/LICENSE.txt'
- 'docs/**'
- 'ISSUE_TEMPLATE/**'
- '**/remove-old-artifacts.yml'
- '**/build-installer.yml'
- '**/release.yml'
env:
BUILD_TYPE: Release
concurrency:
group: environment-${{ github.ref }}
cancel-in-progress: true
jobs:
integration-tests:
strategy:
matrix:
engine_version: ["lts", "latest"]
name: Integration Tests
runs-on: ubuntu-latest
env:
CMAKE_GENERATOR: Unix Makefiles
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Install build dependencies
run: sudo apt-get update && sudo apt-get install libcurl4 && sudo apt-get install libcurl4-openssl-dev
- name: Cache AWS SDK libraries
id: cache-dynamic-aws-sdk
uses: actions/cache@v4
with:
path: |
aws_sdk
key: ${{ runner.os }}-aws-sdk-dynamic-lib
- name: Build and install AWS SDK C++
working-directory: ./scripts
if: steps.cache-dynamic-aws-sdk.outputs.cache-hit != 'true'
run: |
./build_aws_sdk_unix.sh $BUILD_TYPE
- name: 'Set up JDK 8'
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: 8
- name: 'Configure AWS Credentials'
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
- name: 'Set up Temp AWS Credentials'
run: |
creds=($(aws sts get-session-token \
--duration-seconds 21600 \
--query 'Credentials.[AccessKeyId, SecretAccessKey, SessionToken]' \
--output text \
| xargs));
echo "::add-mask::${creds[0]}"
echo "::add-mask::${creds[1]}"
echo "::add-mask::${creds[2]}"
echo "TEMP_AWS_ACCESS_KEY_ID=${creds[0]}" >> $GITHUB_ENV
echo "TEMP_AWS_SECRET_ACCESS_KEY=${creds[1]}" >> $GITHUB_ENV
echo "TEMP_AWS_SESSION_TOKEN=${creds[2]}" >> $GITHUB_ENV
- name: 'Run Integration Tests'
working-directory: ${{ github.workspace }}/testframework
run: |
./gradlew --no-parallel --no-daemon test-failover --info
env:
TEST_DSN: awsmysqlodbca
TEST_USERNAME: ${{ secrets.TEST_USERNAME }}
TEST_PASSWORD: ${{ secrets.TEST_PASSWORD }}
AWS_ACCESS_KEY_ID: ${{ env.TEMP_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ env.TEMP_AWS_SECRET_ACCESS_KEY }}
AWS_SESSION_TOKEN: ${{ env.TEMP_AWS_SESSION_TOKEN }}
DB_ENGINE_VERSION: ${{ matrix.engine_version }}
RDS_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
DRIVER_PATH: ${{ github.workspace }}
- name: 'Get Github Action IP'
if: always()
id: ip
uses: haythem/[email protected]
- name: 'Remove Github Action IP'
if: always()
run: |
aws ec2 revoke-security-group-ingress \
--group-name default \
--protocol tcp \
--port 3306 \
--cidr ${{ steps.ip.outputs.ipv4 }}/32 \
2>&1 > /dev/null;
- name: 'Display and save log'
if: always()
working-directory: ${{ github.workspace }}
run: |
echo "Displaying logs"
mkdir -p ./reports/tests
if [[ -f myodbc.log && -s myodbc.log ]]; then
cat myodbc.log
cp myodbc.log ./reports/tests/myodbc.log
fi
- name: 'Archive log results'
if: always()
uses: actions/upload-artifact@v4
with:
name: 'integration-test-logs-${{ matrix.engine_version }}'
path: reports/tests/
retention-days: 3