chore: update query cache #257
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: PharmCAT CI | |
on: | |
workflow_dispatch: | |
branches: | |
- '*' | |
push: | |
branches: | |
- '*' | |
paths: | |
- '.github/workflows/ci-pharmcat.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@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: | | |
17 | |
21 | |
cache: 'gradle' | |
- name: Run PharmCAT tests | |
run: ./gradlew test --no-daemon --info --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: Run PharmCAT tests on Java 21 | |
run: ./gradlew testOnJava21 --no-daemon --info --scan | |
- uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: ci-pharmcat-tests-jdk21 | |
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() | |
uses: slackapi/slack-github-action@v1 | |
with: | |
channel-id: 'dev' | |
payload: | | |
{ | |
"attachments": [{ | |
"color": "#ff0000", | |
"blocks": [ | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": ":stop: <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|FAILED ${{ github.workflow }}!>" | |
} | |
}, | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": "Triggered by ${{ github.event_name }} on <${{ github.event.pull_request.html_url || github.event.head_commit.url }}|${{ github.ref_name }}> by ${{ github.actor }}." | |
} | |
}, | |
{ | |
"type": "context", | |
"elements": [ | |
{ | |
"type": "mrkdwn", | |
"text": "Last commit:\n${{ github.event.head_commit.message }}" | |
} | |
] | |
} | |
] | |
}] | |
} | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }} |