Setup CI
This commit is contained in:
+30
-20
@@ -1,34 +1,44 @@
|
||||
name: CI Workflow
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- 'v*'
|
||||
branches: [ main, master, develop ]
|
||||
pull_request:
|
||||
branches: [ main, master, develop ]
|
||||
jobs:
|
||||
# Configure the JDK
|
||||
setup-java:
|
||||
# Build the project
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-java@v4
|
||||
- name: "Pull the project"
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: "Setup JDK + Gradle cache"
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: "21"
|
||||
- run: chmod +x ./gradlew
|
||||
cache: "gradle"
|
||||
|
||||
# Run tests
|
||||
test:
|
||||
needs: setup-java
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: ./gradlew --no-daemon test
|
||||
- name: "Make gradlew executable"
|
||||
run: chmod +x ./gradlew
|
||||
|
||||
# Run build
|
||||
build:
|
||||
- name: "Check Lint"
|
||||
run: ./gradlew ktlintCheck --parallel
|
||||
|
||||
- name: "Run test"
|
||||
run: ./gradlew check build --continue
|
||||
|
||||
# Send notification
|
||||
send-notification:
|
||||
needs:
|
||||
- setup-java
|
||||
- test
|
||||
- build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: ./gradlew --no-daemon build
|
||||
- name: "Send notification to Telegram"
|
||||
if: always()
|
||||
uses: appleboy/telegram-action@master
|
||||
with:
|
||||
to: ${{ secrets.TELEGRAM_CHAT_ID }}
|
||||
token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
|
||||
run: |
|
||||
Hello test
|
||||
Reference in New Issue
Block a user