This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | library & demo app | |
on: [ push, pull_request ] | |
jobs: | |
lib-modules-build: | |
name: Build library modules | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Official Gradle Wrapper Validation Action | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '17' | |
distribution: adopt | |
- name: Set up Gradle cache | |
uses: actions/cache@v3 | |
with: | |
key: ${{ runner.os }}-gradle-${{ github.run_id }} | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Grant execute permission for gradlew script | |
run: chmod +x gradlew | |
- name: Build all lib modules except demo app | |
run: ./gradlew build -x :demo-app:build -x check | |
lib-modules-check: | |
name: Run check tasks on library modules | |
runs-on: ubuntu-latest | |
needs: lib-modules-build | |
strategy: | |
matrix: | |
konstellation_modules: [ | |
':core', | |
':charts:line', | |
] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '17' | |
distribution: adopt | |
- name: Set up Gradle cache | |
uses: actions/cache@v3 | |
with: | |
key: ${{ runner.os }}-gradle-${{ github.run_id }} | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
- name: Check ${{ matrix.konstellation_modules }} | |
run: ./gradlew "${{ matrix.konstellation_modules }}:check" | |
- name: Test reporting | |
uses: mikepenz/action-junit-report@v3 | |
if: success() || failure() | |
with: | |
report_paths: '**/test-results/testReleaseUnitTest/**/*.xml' | |
detailed_summary: true | |
demo-app-build: | |
name: Build demo app | |
runs-on: ubuntu-latest | |
needs: lib-modules-build | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '17' | |
distribution: adopt | |
- name: Set up Gradle cache | |
uses: actions/cache@v3 | |
with: | |
key: ${{ runner.os }}-gradle-${{ github.run_id }} | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
- name: Build demo app | |
run: ./gradlew :demo-app:build | |
delete-cache: | |
name: Delete cache | |
if: always() | |
runs-on: ubuntu-latest | |
needs: [ lib-modules-check, demo-app-build ] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Delete cache | |
run: | | |
gh extension install actions/gh-actions-cache | |
set +e | |
gh actions-cache delete ${{ runner.os }}-gradle-${{ github.run_id }} --confirm | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |