ci: run check on affected modules via the gradle build cache instead of a full test matrix

This commit is contained in:
Fiereu committed 2026-07-20 23:54:54 +02:00
1 parent 4b533bd099
commit ed06884b10
1 file changed
+14 -18
+14 -18
View File
@@ -1,36 +1,32 @@
name: Test
on:
workflow_run:
workflows: [ "Spotless" ]
types: [ completed ]
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
permissions:
contents: read
concurrency:
group: test-${{ github.event.workflow_run.head_branch || github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test (${{ matrix.module }})
name: Test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
module:
- patcher
- common
- bytecodec
- network
- protocols.login
- protocols.game
- server.login
- server.game
- codegen
if: ${{ github.event_name == 'push' || github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
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
uses: actions/setup-java@v4
@@ -41,5 +37,5 @@ jobs:
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
- name: Run tests
run: ./gradlew :${{ matrix.module }}:test
- name: Run checks
run: ./gradlew check