-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #116 from DataBiosphere/mf-run-unit-tests
PF-2033, PF-2989: Trigger Unit Tests On PR Commits
- Loading branch information
Showing
2 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: Build and Test | ||
|
||
on: | ||
push: | ||
branches: [ develop ] | ||
paths-ignore: [ '*.md' ] | ||
pull_request: | ||
branches: [ '**' ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: 'gradle' | ||
- name: Build with Gradle | ||
# TODO: Spotbugs references can be removed once | ||
# https://github.com/DataBiosphere/stairway/pull/115 is merged | ||
run: ./gradlew build -x test -x spotBugsMain -x spotBugsTest | ||
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@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: 'gradle' | ||
- name: Run tests | ||
run: ./gradlew test | ||
|
||
# TODO: Work with AppSec to get Sonar scans setup for this repo | ||
# Run the Sonar scan after `gradle test` to include code coverage data in its report. | ||
# - name: Sonar scan | ||
# run: ./gradlew --build-cache sonar | ||
# 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' |
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