This repository has been archived by the owner on Dec 5, 2023. It is now read-only.
chore: merge upstream branch gradle/master
into main
#278
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
name: Test Sub-projects | |
on: | |
push: | |
branches: ['*'] | |
paths: | |
- 'platforms/**' | |
- 'subprojects/**' | |
pull_request: | |
branches: ['*'] | |
paths: | |
- 'platforms/**' | |
- 'subprojects/**' | |
concurrency: | |
# On main/release, we don't want any jobs cancelled so the sha is used to name the group | |
# On PR branches, we cancel the job if new commits are pushed | |
group: ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/release' ) && format('contributor-pr-base-{0}', github.sha) || format('contributor-pr-{0}', github.ref) }} | |
cancel-in-progress: true | |
env: | |
# Set the GRADLE_ENTERPRISE_ACCESS_KEY so that Gradle Build Scans are generated | |
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | |
# Enable debug for the `gradle-build-action` cache operations | |
GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true | |
permissions: | |
contents: read | |
jobs: | |
build: | |
name: "Compile All" | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: git clone | |
uses: actions/checkout@v3 | |
- id: setup-matrix | |
run: echo "matrix=$(jq -c -f .github/workflows/extract-unit-test-split.jq .teamcity/subprojects.json)" >> $GITHUB_OUTPUT | |
- name: setup java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- id: determine-sys-prop-args | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
if (context.payload.pull_request && context.payload.pull_request.head.repo.fork) { | |
core.setOutput('sys-prop-args', '-DagreePublicBuildScanTermOfService=yes -DcacheNode=us') | |
} else { | |
core.setOutput('sys-prop-args', '-DcacheNode=us') | |
} | |
- name: assemble | |
id: gradle | |
uses: gradle/gradle-build-action@v2 | |
with: | |
cache-read-only: ${{ github.ref != 'refs/heads/main' }} | |
arguments: | | |
compileAll | |
--no-configuration-cache | |
-DdisableLocalCache=true | |
${{ steps.determine-sys-prop-args.outputs.sys-prop-args }} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: build-receipt.properties | |
path: build/generated-resources/build-receipt/org/gradle/build-receipt.properties | |
outputs: | |
matrix: ${{ steps.setup-matrix.outputs.matrix }} | |
sys-prop-args: ${{ steps.determine-sys-prop-args.outputs.sys-prop-args }} | |
unit-test: | |
name: "${{ matrix.bucket.name }} (Quick Test)" | |
runs-on: ubuntu-20.04 | |
needs: build | |
strategy: | |
matrix: | |
bucket: ${{ fromJson(needs.build.outputs.matrix) }} | |
fail-fast: false | |
steps: | |
- name: git clone | |
uses: actions/checkout@v3 | |
- name: setup java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: build-receipt.properties | |
path: incoming-distributions/build-receipt.properties | |
- name: ./gradlew test | |
id: gradle | |
uses: gradle/gradle-build-action@v2 | |
with: | |
cache-read-only: ${{ github.ref != 'refs/heads/main' }} | |
arguments: | | |
${{ matrix.bucket.tasks }} | |
--no-configuration-cache | |
-DdisableLocalCache=true | |
-PflakyTests=exclude | |
${{ needs.build.outputs.sys-prop-args }} |