Skip to content

Commit

Permalink
Create build.yml
Browse files Browse the repository at this point in the history
Added Github Action for building and running tests on push. Recommendations from MikAoJk.
  • Loading branch information
echokrist authored Jan 4, 2025
1 parent 8e40753 commit e84d5ac
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: build main branch
on:
push:
branches:
- main
jobs:
build:
name: Checkout code and test, clean build
runs-on: ubuntu-latest
steps:
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('build.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-cache-
- uses: actions/cache@v4
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-wrapper-
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Run tests
run: |
./gradlew test
- name: Run clean build
run: |
./gradlew clean build

0 comments on commit e84d5ac

Please sign in to comment.