name: Efficient pull request validation for Gradle example
LAUNCHABLE_ORGANIZATION: "examples"
LAUNCHABLE_WORKSPACE: "gradle"
- name: Pull request validation
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
export PATH=~/.local/bin:$PATH
# Tell Launchable about the build you are producing and testing
launchable record build --name $BUILD_NAME --source ..
# Find 25% of the relevant tests to run for this change
launchable subset --target 25% --build $GITHUB_RUN_ID gradle src/test/java > subset.txt
launchable record test --build $GITHUB_RUN_ID gradle build/test-results/test
# Run gradle with the subset of tests
./gradlew test $(< subset.txt)
working-directory: ./gradle
GITHUB_PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}