From e84d5ac72f86c99a1bd5c3f27201b6e1dc0dacf0 Mon Sep 17 00:00:00 2001 From: echokrist Date: Sat, 4 Jan 2025 14:40:56 +0100 Subject: [PATCH] Create build.yml Added Github Action for building and running tests on push. Recommendations from MikAoJk. --- .github/workflows/build.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..3de22da --- /dev/null +++ b/.github/workflows/build.yml @@ -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