diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..9073a9c --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,28 @@ +name: coverage + +on: + push: + branches: [ main ] + +jobs: + create-coverage: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: '16' + distribution: 'adopt' + - name: Generate and upload coverage report + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + run: ./gradlew build jacocoTestReport coveralls + - name: Cleanup Gradle Cache + # Remove some files from the Gradle cache, so they aren't cached by GitHub Actions. + # Restoring these files from a GitHub Actions cache might cause problems for future builds. + run: | + rm -f ~/.gradle/caches/modules-2/modules-2.lock + rm -f ~/.gradle/caches/modules-2/gc.properties diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index b320244..161e042 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -7,49 +7,13 @@ on: branches: [ main ] jobs: - build-test-and-coverage-on-linux: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up JDK - uses: actions/setup-java@v2 - with: - java-version: '16' - distribution: 'adopt' - - name: Cache Gradle packages - uses: actions/cache@v2 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} - restore-keys: | - ${{ runner.os }}-gradle- - - name: Build with Gradle and generate the artifacts - run: ./gradlew assemble test - - name: Generate and upload coverage report - env: - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} - run: ./gradlew jacocoTestReport coveralls - - uses: actions/upload-artifact@v2 - with: - name: Package - path: build/libs - - name: Cleanup Gradle Cache - # Remove some files from the Gradle cache, so they aren't cached by GitHub Actions. - # Restoring these files from a GitHub Actions cache might cause problems for future builds. - run: | - rm -f ~/.gradle/caches/modules-2/modules-2.lock - rm -f ~/.gradle/caches/modules-2/gc.properties - - test-on-linux: + build-and-test-on-linux: runs-on: ubuntu-latest strategy: matrix: - java-version: [ 8, 11 ] + java-version: [ 8, 11, 16 ] steps: - uses: actions/checkout@v2 @@ -76,7 +40,7 @@ jobs: rm -f ~/.gradle/caches/modules-2/modules-2.lock rm -f ~/.gradle/caches/modules-2/gc.properties - test-on-macos: + builad-and-test-on-macos: runs-on: macos-latest strategy: