feat: add connection pooling to fix db connection exhaustion (#536) #318
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: Build and Test | |
| on: | |
| push: | |
| branches: [master, dev] | |
| paths-ignore: | |
| - '**.md' | |
| - '.github/ISSUE_TEMPLATE' | |
| - '.gitignore' | |
| - 'provisioning' | |
| - '.sonarcloud.properties' | |
| - 'LICENSE' | |
| - 'Vagrantfile' | |
| pull_request: | |
| branches: [master, dev] | |
| paths-ignore: | |
| - '**.md' | |
| - '.github/ISSUE_TEMPLATE' | |
| - '.gitignore' | |
| - 'provisioning' | |
| - '.sonarcloud.properties' | |
| - 'LICENSE' | |
| - 'Vagrantfile' | |
| jobs: | |
| dependency-review: | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/dependency-review-action@v4 | |
| with: | |
| fail-on-severity: critical | |
| lint-java: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '24' | |
| - uses: axel-op/googlejavaformat-action@c1134ebd196c4cbffb077f9476585b0be8b6afcd #v4 | |
| with: | |
| args: "--set-exit-if-changed" | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '8' | |
| cache: maven | |
| - name: Build Maven with Docker Profile | |
| run: mvn clean install -Pdocker -DskipTests -B | |
| - name: Docker Compose Build | |
| run: docker compose build | |
| unit-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '8' | |
| cache: maven | |
| - name: Run Unit Tests | |
| run: mvn test -B -e | |
| integration-tests: | |
| runs-on: ubuntu-latest | |
| services: | |
| mysql: | |
| image: mysql:5.7 | |
| env: | |
| MYSQL_ROOT_PASSWORD: password | |
| MYSQL_DATABASE: core | |
| ports: | |
| - '8888:3306' | |
| options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '8' | |
| cache: maven | |
| - name: Start MYSQL Server | |
| run: sudo /etc/init.d/mysql start | |
| - name: Modify MySQL Connection Variables | |
| run: | | |
| sed -i "s/'@'localhost'/'@'%'/g" ${GITHUB_WORKSPACE}/src/main/resources/database/moduleSchemas.sql | |
| sed -i 's/TEST_MYSQL_PORT=3306/TEST_MYSQL_PORT=8888/g' ${GITHUB_WORKSPACE}/.env | |
| - name: Prepare Integration Tests | |
| run: | | |
| sudo apt-get -y install libargon2-1 | |
| mvn -Pdocker validate | |
| - name: Run Integration Tests | |
| run: | | |
| mvn verify -DskipUTs=true -DmongoDocker -B |