diff --git a/.github/workflows/build_pull_request.yml b/.github/workflows/build_pull_request.yml new file mode 100644 index 000000000..aba0bc981 --- /dev/null +++ b/.github/workflows/build_pull_request.yml @@ -0,0 +1,33 @@ +name: PR build check +on: + pull_request: + +jobs: + build: + name: Build app + runs-on: ubuntu-latest + + steps: + - name: Clone repo + uses: actions/checkout@v2 + + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v1 + + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Copy CI gradle.properties + run: | + mkdir -p ~/.gradle + cp .github/runner-files/ci-gradle.properties ~/.gradle/gradle.properties + + - name: Build app + uses: eskatos/gradle-command-action@v1 + with: + arguments: assembleStandardRelease + wrapper-cache-enabled: true + dependencies-cache-enabled: true + configuration-cache-enabled: true diff --git a/.github/workflows/build.yml b/.github/workflows/build_push.yml similarity index 93% rename from .github/workflows/build.yml rename to .github/workflows/build_push.yml index 8868196f4..cc65fe1a0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build_push.yml @@ -5,23 +5,10 @@ on: - master tags: - v* - pull_request: jobs: - check_wrapper: - name: Validate Gradle Wrapper - runs-on: ubuntu-latest - - steps: - - name: Clone repo - uses: actions/checkout@v2 - - - name: Validate Gradle Wrapper - uses: gradle/wrapper-validation-action@v1 - build: name: Build app - needs: check_wrapper runs-on: ubuntu-latest steps: @@ -33,6 +20,9 @@ jobs: - name: Clone repo uses: actions/checkout@v2 + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v1 + - name: Set up JDK 11 uses: actions/setup-java@v1 with: diff --git a/.github/workflows/cancel_pull_request.yml b/.github/workflows/cancel_pull_request.yml new file mode 100644 index 000000000..4d6b65f1e --- /dev/null +++ b/.github/workflows/cancel_pull_request.yml @@ -0,0 +1,15 @@ +name: Cancel old pull request workflows + +on: + workflow_run: + workflows: ["PR build check"] + types: + - requested + +jobs: + cancel: + runs-on: ubuntu-latest + steps: + - uses: styfle/cancel-workflow-action@0.8.0 + with: + workflow_id: ${{ github.event.workflow.id }}