[skip ci] Split push and PR build workflows so they don't cancel each other

This commit is contained in:
arkon 2021-08-15 11:07:27 -04:00
parent 4c8dfd0c0c
commit bc41040fd3
3 changed files with 51 additions and 13 deletions

View file

@ -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

View file

@ -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:

View file

@ -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 }}