diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 5c3984af..2b4b8e25 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -1,25 +1,27 @@ name: Android CI -on: - workflow_dispatch: - workflow_run: - workflows: [ 'Code format check' ] - types: [ completed ] +on: [ push ] jobs: build: runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.event.workflow_run.head_branch }} + - name: set up JDK uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '17' + - name: Verify code format + run: ./gradlew spotlessCheck || echo "::error title=Code format check failed::Use ./gradlew applySpotless to fix" && exit 1 + - name: Build with Gradle run: NO_GPG_SIGN=true ./gradlew --stacktrace check test build javadocJar publishToMavenLocal diff --git a/.github/workflows/code-formatting.yml b/.github/workflows/code-formatting.yml deleted file mode 100644 index 98c9020f..00000000 --- a/.github/workflows/code-formatting.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Code format check - -on: [ workflow_dispatch, push ] - -jobs: - check-format: - - runs-on: ubuntu-latest - - steps: - - name: Check out code - uses: actions/checkout@v4 - - - name: set up JDK - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '17' - - - name: Check code formatting - run: ./gradlew spotlessCheck -