ci: run check on affected modules via the gradle build cache instead of a full test matrix
This commit is contained in:
1 parent
4b533bd099
commit
ed06884b10
1 file changed
+14
-18
+14
-18
@@ -1,36 +1,32 @@
|
|||||||
name: Test
|
name: Test
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows: [ "Spotless" ]
|
||||||
|
types: [ completed ]
|
||||||
push:
|
push:
|
||||||
branches: [ "master" ]
|
branches: [ "master" ]
|
||||||
pull_request:
|
|
||||||
branches: [ "master" ]
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: test-${{ github.event.workflow_run.head_branch || github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: Test (${{ matrix.module }})
|
name: Test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
if: ${{ github.event_name == 'push' || github.event.workflow_run.conclusion == 'success' }}
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
module:
|
|
||||||
- patcher
|
|
||||||
- common
|
|
||||||
- bytecodec
|
|
||||||
- network
|
|
||||||
- protocols.login
|
|
||||||
- protocols.game
|
|
||||||
- server.login
|
|
||||||
- server.game
|
|
||||||
- codegen
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
# workflow_run starts from the default branch, so check out the branch Spotless just ran
|
||||||
|
# on. Its tip, not head_sha, since Spotless pushes its formatting as a new commit.
|
||||||
|
ref: ${{ github.event.workflow_run.head_branch || github.sha }}
|
||||||
|
|
||||||
- name: Set up JDK 25
|
- name: Set up JDK 25
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
@@ -41,5 +37,5 @@ jobs:
|
|||||||
- name: Set up Gradle
|
- name: Set up Gradle
|
||||||
uses: gradle/actions/setup-gradle@v4
|
uses: gradle/actions/setup-gradle@v4
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run checks
|
||||||
run: ./gradlew :${{ matrix.module }}:test
|
run: ./gradlew check
|
||||||
Reference in new issue
Block a user