Experiment with serial execution for GH Actions #102
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# File generated by the GradleUtils `setupGitHubActionsWorkflows` task, avoid modifying it directly | |
# The template can be found at https://github.com/neoforged/GradleUtils/blob/a65628b0c89dec60b357ce3f8f6bfa62934b8357/src/actionsTemplate/resources/.github/workflows/build-prs.yml | |
name: Build and test PRs | |
on: | |
pull_request: | |
types: | |
- synchronize | |
- opened | |
- ready_for_review | |
- reopened | |
push: | |
branches: | |
- 'feature/**' | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build | |
uses: neoforged/actions/.github/workflows/build-prs.yml@main | |
with: | |
java: 17 | |
gradle_tasks: test | |
jar_compatibility: false | |
test-project: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
name: Test on ${{ matrix.os }} | |
steps: | |
- name: Checkout project sources | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1000 | |
fetch-tags: true | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: microsoft | |
java-version: 21 | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
build-scan-publish: true | |
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service" | |
build-scan-terms-of-use-agree: "yes" | |
- name: Run build | |
run: ./gradlew --max-workers=1 build | |
working-directory: ./testproject | |
- name: Ensure clean, build and test work in the same run | |
run: ./gradlew --max-workers=1 clean build check | |
working-directory: ./testproject | |
- name: Ensure runData runs | |
run: ./gradlew --max-workers=1 runData | |
working-directory: ./testproject |