Merge pull request #163 from DataBiosphere/dependabot/gradle/develop/… #163
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
name: Build and Test | |
on: | |
push: | |
branches: [ develop ] | |
paths-ignore: [ '*.md' ] | |
pull_request: | |
branches: [ '**' ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: 'gradle' | |
- name: Build with Gradle | |
run: ./gradlew build -x test | |
unit-tests: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:13 | |
env: | |
# Default values stairway expects based on DEVELOPMENT.md | |
POSTGRES_PASSWORD: stairwaypw | |
POSTGRES_USER: stairwayuser | |
POSTGRES_DB: stairwaylib | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: [ "5432:5432" ] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: 'gradle' | |
- name: Run tests | |
run: ./gradlew test --scan jacocoTestReport | |
# Run the Sonar scan after `gradle test` to include code coverage data in its report. | |
- name: Sonar scan | |
run: ./gradlew --build-cache sonar --info | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# TODO: Once Terraform PR is setup, uncomment the following block | |
# to enable workflow reporting to slack | |
# report workflow status in slack | |
# see https://docs.google.com/document/d/1G6-whnNJvON6Qq1b3VvRJFC7M9M-gu2dAVrQHDyp9Us/edit?usp=sharing | |
# report-workflow: | |
# uses: broadinstitute/sherlock/.github/workflows/client-report-workflow.yaml@main | |
# with: | |
# Channels to notify upon workflow success or failure | |
# notify-slack-channels-upon-workflow-completion: '#platform-foundation' | |
# Channels to notify upon workflow success only | |
# notify-slack-channels-upon-workflow-success: "#channel-here" | |
# Channels to notify upon workflow failure only | |
# notify-slack-channels-upon-workflow-failure: "#channel-here" | |
# permissions: | |
# id-token: 'write' |