feat: support appointments with an operation #1
Workflow file for this run
This file contains hidden or 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
# .github/workflows/ci.yml | |
name: CI | |
on: | |
push: | |
branches: [ main ] | |
paths: ['**/*.kt', '**/*.kts', '.github/workflows/ci.yml'] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
if: github.event_name == 'push' || github.event_name == 'pull_request' | |
runs-on: ubuntu-latest | |
name: "Run Tests" | |
env: | |
GH_USERNAME: ${{ github.actor }} | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set envs | |
run: | | |
echo "GITHUB_CURRENT_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
echo "GITHUB_CURRENT_REPO_NAME=${GITHUB_REPOSITORY}" >> $GITHUB_ENV | |
echo "GITHUB_CURRENT_REPO_URL=https://github.com/${GITHUB_REPOSITORY}" >> $GITHUB_ENV | |
echo "GITHUB_CURRENT_RUN_URL=https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" >> $GITHUB_ENV | |
echo "GITHUB_CURRENT_RUN_ID=${GITHUB_RUN_ID}" >> $GITHUB_ENV | |
echo "GITHUB_CURRENT_RUN_TRIGGERING_ACTOR=${GITHUB_TRIGGERING_ACTOR}" >> $GITHUB_ENV | |
echo "GITHUB_CURRENT_RUN_ATTEMPT=${GITHUB_RUN_ATTEMPT}" >> $GITHUB_ENV | |
- name: Notify slack on test start | |
id: slack-test-start | |
uses: slackapi/[email protected] | |
with: | |
channel-id: "C060CAKN98T" | |
payload: | | |
{ | |
"blocks": [ | |
{ | |
"type": "section", | |
"fields": [ | |
{ | |
"type": "mrkdwn", | |
"text": "*Application:*\n<${{ env.GITHUB_CURRENT_REPO_URL }}|${{ env.GITHUB_CURRENT_REPO_NAME }}>" | |
}, | |
{ | |
"type": "mrkdwn", | |
"text": "*Branch:*\n`${{ env.GITHUB_CURRENT_BRANCH }}`" | |
}, | |
{ | |
"type": "mrkdwn", | |
"text": "*Tests:*\n:large_yellow_circle: Running <${{ env.GITHUB_CURRENT_RUN_URL }}|(view)>" | |
} | |
] | |
} | |
] | |
} | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
- name: Set up JDK 23 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 23 | |
- name: Cache Gradle dependencies | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
gradle-${{ runner.os }}- | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Test | |
run: ./gradlew test | |
- name: Notify slack on passed tests | |
id: slack-tests-passed | |
uses: slackapi/[email protected] | |
with: | |
channel-id: "C060CAKN98T" | |
update-ts: ${{ steps.slack-test-start.outputs.ts }} | |
payload: | | |
{ | |
"blocks": [ | |
{ | |
"type": "section", | |
"fields": [ | |
{ | |
"type": "mrkdwn", | |
"text": "*Application:*\n<${{ env.GITHUB_CURRENT_REPO_URL }}|${{ env.GITHUB_CURRENT_REPO_NAME }}>" | |
}, | |
{ | |
"type": "mrkdwn", | |
"text": "*Branch:*\n`${{ env.GITHUB_CURRENT_BRANCH }}`" | |
}, | |
{ | |
"type": "mrkdwn", | |
"text": "*Tests:*\n:large_green_circle: Passed <${{ env.GITHUB_CURRENT_RUN_URL }}|(view)>" | |
} | |
] | |
} | |
] | |
} | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
- name: Notify slack on failed tests | |
if: ${{ failure() }} | |
id: slack-tests-failed | |
uses: slackapi/[email protected] | |
with: | |
channel-id: "C060CAKN98T" | |
update-ts: ${{ steps.slack-test-start.outputs.ts }} | |
payload: | | |
{ | |
"blocks": [ | |
{ | |
"type": "section", | |
"fields": [ | |
{ | |
"type": "mrkdwn", | |
"text": "*Application:*\n<${{ env.GITHUB_CURRENT_REPO_URL }}|${{ env.GITHUB_CURRENT_REPO_NAME }}>" | |
}, | |
{ | |
"type": "mrkdwn", | |
"text": "*Branch:*\n`${{ env.GITHUB_CURRENT_BRANCH }}`" | |
}, | |
{ | |
"type": "mrkdwn", | |
"text": "*Tests:*\n:red_circle: Failed <${{ env.GITHUB_CURRENT_RUN_URL }}|(view)>" | |
} | |
] | |
} | |
] | |
} | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |