DDO-3917-scale-down-buffer-pools (#374) #1525
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
# This workflow will build a Java project with Gradle | |
# Copied from Janitor(https://github.com/DataBiosphere/terra-resource-janitor) and similar to all other MCTerra servers. | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle | |
name: Run Tests | |
on: | |
workflow_dispatch: {} | |
push: | |
branches: [ master ] | |
paths-ignore: [ '**.md' ] | |
pull_request: | |
# Branch settings require status checks before merging, so don't add paths-ignore. | |
branches: [ master ] | |
env: | |
VAULT_ADDR: https://clotho.broadinstitute.org:8200 | |
jobs: | |
unit-test: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:16.3 | |
env: | |
POSTGRES_PASSWORD: postgres | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Skip version bump merges | |
id: skiptest | |
uses: ./.github/actions/bump-skip | |
with: | |
event-name: ${{ github.event_name }} | |
- name: Write credentials for integration tests | |
if: steps.skiptest.outputs.is-bump == 'no' | |
id: write-credentials | |
uses: ./.github/actions/write-credentials | |
with: | |
janitor-sa-b64: ${{ secrets.JANITOR_SA_DEV }} | |
buffer-app-sa-b64: ${{ secrets.BUFFER_APP_SA_DEV }} | |
- name: Initialize Postgres DB | |
if: steps.skiptest.outputs.is-bump == 'no' | |
env: | |
PGPASSWORD: postgres | |
run: psql -h 127.0.0.1 -U postgres -f ./local-dev/local-postgres-init.sql | |
- name: Set up JDK 17 | |
if: steps.skiptest.outputs.is-bump == 'no' | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Check Javadoc | |
if: steps.skiptest.outputs.is-bump == 'no' | |
run: ./gradlew javadoc --scan | |
- name: Run unit tests | |
if: steps.skiptest.outputs.is-bump == 'no' | |
id: unit-test | |
run: ./gradlew unitTest --scan | |
- name: Run integration tests | |
if: steps.skiptest.outputs.is-bump == 'no' | |
id: integration-test | |
run: ./gradlew integrationTest --scan | |
- name: Upload Test Reports | |
if: always() && steps.skiptest.outputs.is-bump == 'no' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Test Reports | |
path: build/reports | |
- name: Upload Jacoco Reports | |
if: always() && steps.skiptest.outputs.is-bump == 'no' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Test Reports | |
path: build/jacoco |