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