Skip to content

Update build.gradle.kts #4

Update build.gradle.kts

Update build.gradle.kts #4

Workflow file for this run

name: Build and Test Kotlin Project
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
# 1. Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3
# 2. Set up JDK (Java Development Kit)
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
# 3. Make gradlew executable
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
# 4. Cache Gradle dependencies
- name: Cache Gradle dependencies
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
# 5. Build the project
- name: Build with Gradle
run: ./gradlew build
# 6. Run tests
- name: Run tests
run: ./gradlew test