Update dependency org.openrewrite.maven:rewrite-maven-plugin to v5.5.0 #1031
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: Java CI | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
# https://github.com/actions/setup-java | |
- name: Set up JDK 1.11 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- name: Cache maven dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/ | |
key: ${{ runner.OS }}-maven-${{ hashFiles('pom.xml') }} | |
restore-keys: | | |
${{ runner.OS }}-maven-${{ hashFiles('pom.xml') }}- | |
${{ runner.OS }}-maven- | |
${{ runner.OS }}- | |
- name: Build | |
# We `install` to make cleanthat available through spotless | |
run: mvn install --file pom.xml -Pfast | |
- name: Tests | |
run: mvn install -PskipStyle,skipITs | |
# https://app.codecov.io/gh/solven-eu/cleanthat/new | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
- name: Spotless Check - Apply if failed | |
continue-on-error: true | |
# https://joht.github.io/johtizen/build/2022/01/20/github-actions-push-into-repository.html#example-1 | |
# https://stackoverflow.com/questions/55657835/is-there-a-way-to-push-changes-with-a-github-action | |
run: | | |
set -euxo pipefail | |
git config --local user.email "github-actions@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
mvn spotless:check || echo "spotless"check failed to we spotless:apply before commit+push" && mvn spotless:apply && git commit -m "mvn spotless:apply" && git push | |
- name: Spotless Check | |
run: mvn spotless:check |