Skip to content

Commit

Permalink
chore: split jdk 17/21 testing
Browse files Browse the repository at this point in the history
  • Loading branch information
markwoon committed Jan 12, 2024
1 parent d990339 commit 117e00f
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 12 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/ci-pharmcat-jdk17.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: PharmCAT CI

on:
workflow_dispatch:
branches:
- '*'
push:
branches:
- '*'
paths:
- '.github/workflows/ci-pharmcat-jdk17.yml'
- 'src/main/**'
- 'src/test/**'
- 'build.gradle'

# cancel current build on push from the same PR, branch or tag (https://stackoverflow.com/a/72408109/1063501)
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build project
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: |
17
cache: 'gradle'

- name: Run PharmCAT tests
run: ./gradlew test --no-daemon --debug --scan

- uses: actions/upload-artifact@v4
if: failure()
with:
name: ci-pharmcat-tests-jdk17
path: build/reports/tests/test/index.html
if-no-files-found: ignore

- name: Codecov
uses: codecov/codecov-action@v3
with:
files: ./build/reports/jacoco/test/jacocoTestReport.xml
flags: unittests

- name: Send Slack notification on failure
if: failure()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel: dev
status: FAILED
color: danger
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches:
- '*'
paths:
- '.github/workflows/ci-pharmcat.yml'
- '.github/workflows/ci-pharmcat-jdk21.yml'
- 'src/main/**'
- 'src/test/**'
- 'build.gradle'
Expand All @@ -32,21 +32,10 @@ jobs:
with:
distribution: 'temurin'
java-version: |
17
21
cache: 'gradle'

- name: Run PharmCAT tests
run: ./gradlew test --no-daemon --debug

- uses: actions/upload-artifact@v4
if: failure()
with:
name: ci-pharmcat-tests-jdk17
path: build/reports/tests/test/index.html
if-no-files-found: ignore

- name: Run PharmCAT tests on Java 21
run: ./gradlew testOnJava21 --no-daemon

- uses: actions/upload-artifact@v4
Expand Down

0 comments on commit 117e00f

Please sign in to comment.