Skip to content

Commit

Permalink
Add tests for dependency graph failures
Browse files Browse the repository at this point in the history
  • Loading branch information
bigdaz committed Jan 12, 2024
1 parent 11693a1 commit e923b23
Show file tree
Hide file tree
Showing 3 changed files with 221 additions and 115 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci-full-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ jobs:
with:
cache-key-prefix: ${{github.run_number}}-

dependency-graph-failures:
uses: ./.github/workflows/integ-test-dependency-graph-failures.yml
with:
cache-key-prefix: ${{github.run_number}}-

execution-with-caching:
uses: ./.github/workflows/integ-test-execution-with-caching.yml
with:
Expand Down
237 changes: 122 additions & 115 deletions .github/workflows/ci-quick-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,41 +14,41 @@ jobs:
- name: Build and upload distribution
uses: ./.github/actions/build-dist

run-unit-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Configure Gradle as default for unit test
uses: ./
with:
gradle-version: 8.5
- name: Run tests
run: |
npm install
npm run all
action-inputs:
needs: build-distribution
uses: ./.github/workflows/integ-test-action-inputs.yml
with:
runner-os: '["ubuntu-latest"]'
download-dist: true

cache-cleanup:
needs: build-distribution
uses: ./.github/workflows/integ-test-cache-cleanup.yml
with:
runner-os: '["ubuntu-latest"]'
download-dist: true
cache-key-prefix: ${{github.run_number}}- # Requires a fresh cache entry each run

caching-config:
needs: build-distribution
uses: ./.github/workflows/integ-test-caching-config.yml
with:
runner-os: '["ubuntu-latest"]'
download-dist: true
# run-unit-tests:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout sources
# uses: actions/checkout@v4
# - name: Configure Gradle as default for unit test
# uses: ./
# with:
# gradle-version: 8.5
# - name: Run tests
# run: |
# npm install
# npm run all

# action-inputs:
# needs: build-distribution
# uses: ./.github/workflows/integ-test-action-inputs.yml
# with:
# runner-os: '["ubuntu-latest"]'
# download-dist: true

# cache-cleanup:
# needs: build-distribution
# uses: ./.github/workflows/integ-test-cache-cleanup.yml
# with:
# runner-os: '["ubuntu-latest"]'
# download-dist: true
# cache-key-prefix: ${{github.run_number}}- # Requires a fresh cache entry each run

# caching-config:
# needs: build-distribution
# uses: ./.github/workflows/integ-test-caching-config.yml
# with:
# runner-os: '["ubuntu-latest"]'
# download-dist: true

dependency-graph:
needs: build-distribution
Expand All @@ -59,88 +59,95 @@ jobs:
runner-os: '["ubuntu-latest"]'
download-dist: true

execution-with-caching:
needs: build-distribution
uses: ./.github/workflows/integ-test-execution-with-caching.yml
with:
runner-os: '["ubuntu-latest"]'
download-dist: true

execution:
needs: build-distribution
uses: ./.github/workflows/integ-test-execution.yml
with:
runner-os: '["ubuntu-latest"]'
download-dist: true

develocity-injection:
needs: build-distribution
uses: ./.github/workflows/integ-test-inject-develocity.yml
with:
runner-os: '["ubuntu-latest"]'
download-dist: true
secrets:
DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_SOLUTIONS_ACCESS_TOKEN }}

provision-gradle-versions:
needs: build-distribution
uses: ./.github/workflows/integ-test-provision-gradle-versions.yml
with:
runner-os: '["ubuntu-latest"]'
download-dist: true

restore-configuration-cache:
needs: build-distribution
uses: ./.github/workflows/integ-test-restore-configuration-cache.yml
with:
runner-os: '["ubuntu-latest"]'
download-dist: true
secrets:
GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }}

restore-containerized-gradle-home:
needs: build-distribution
uses: ./.github/workflows/integ-test-restore-containerized-gradle-home.yml
with:
download-dist: true

restore-custom-gradle-home:
dependency-graph-failures:
needs: build-distribution
uses: ./.github/workflows/integ-test-restore-custom-gradle-home.yml
with:
download-dist: true

restore-gradle-home:
needs: build-distribution
uses: ./.github/workflows/integ-test-restore-gradle-home.yml
uses: ./.github/workflows/integ-test-dependency-graph-failures.yml
with:
runner-os: '["ubuntu-latest"]'
download-dist: true

restore-java-toolchain:
needs: build-distribution
uses: ./.github/workflows/integ-test-restore-java-toolchain.yml
with:
runner-os: '["ubuntu-latest"]'
download-dist: true

sample-kotlin-dsl:
needs: build-distribution
uses: ./.github/workflows/integ-test-sample-kotlin-dsl.yml
with:
runner-os: '["ubuntu-latest"]'
download-dist: true

sample-gradle-plugin:
needs: build-distribution
uses: ./.github/workflows/integ-test-sample-gradle-plugin.yml
with:
runner-os: '["ubuntu-latest"]'
download-dist: true

toolchain-detection:
needs: build-distribution
uses: ./.github/workflows/integ-test-detect-java-toolchains.yml
with:
runner-os: '["ubuntu-latest"]'
download-dist: true
# execution-with-caching:
# needs: build-distribution
# uses: ./.github/workflows/integ-test-execution-with-caching.yml
# with:
# runner-os: '["ubuntu-latest"]'
# download-dist: true

# execution:
# needs: build-distribution
# uses: ./.github/workflows/integ-test-execution.yml
# with:
# runner-os: '["ubuntu-latest"]'
# download-dist: true

# develocity-injection:
# needs: build-distribution
# uses: ./.github/workflows/integ-test-inject-develocity.yml
# with:
# runner-os: '["ubuntu-latest"]'
# download-dist: true
# secrets:
# DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_SOLUTIONS_ACCESS_TOKEN }}

# provision-gradle-versions:
# needs: build-distribution
# uses: ./.github/workflows/integ-test-provision-gradle-versions.yml
# with:
# runner-os: '["ubuntu-latest"]'
# download-dist: true

# restore-configuration-cache:
# needs: build-distribution
# uses: ./.github/workflows/integ-test-restore-configuration-cache.yml
# with:
# runner-os: '["ubuntu-latest"]'
# download-dist: true
# secrets:
# GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }}

# restore-containerized-gradle-home:
# needs: build-distribution
# uses: ./.github/workflows/integ-test-restore-containerized-gradle-home.yml
# with:
# download-dist: true

# restore-custom-gradle-home:
# needs: build-distribution
# uses: ./.github/workflows/integ-test-restore-custom-gradle-home.yml
# with:
# download-dist: true

# restore-gradle-home:
# needs: build-distribution
# uses: ./.github/workflows/integ-test-restore-gradle-home.yml
# with:
# runner-os: '["ubuntu-latest"]'
# download-dist: true

# restore-java-toolchain:
# needs: build-distribution
# uses: ./.github/workflows/integ-test-restore-java-toolchain.yml
# with:
# runner-os: '["ubuntu-latest"]'
# download-dist: true

# sample-kotlin-dsl:
# needs: build-distribution
# uses: ./.github/workflows/integ-test-sample-kotlin-dsl.yml
# with:
# runner-os: '["ubuntu-latest"]'
# download-dist: true

# sample-gradle-plugin:
# needs: build-distribution
# uses: ./.github/workflows/integ-test-sample-gradle-plugin.yml
# with:
# runner-os: '["ubuntu-latest"]'
# download-dist: true

# toolchain-detection:
# needs: build-distribution
# uses: ./.github/workflows/integ-test-detect-java-toolchains.yml
# with:
# runner-os: '["ubuntu-latest"]'
# download-dist: true
94 changes: 94 additions & 0 deletions .github/workflows/integ-test-dependency-graph-failures.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Test dependency graph

on:
workflow_call:
inputs:
cache-key-prefix:
type: string
runner-os:
type: string
default: '["ubuntu-latest"]'
download-dist:
type: boolean
default: false

env:
DOWNLOAD_DIST: ${{ inputs.download-dist }}
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: dependency-graph-${{ inputs.cache-key-prefix }}
GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true

jobs:
unsupported-gradle-version-failure:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Download distribution if required
uses: ./.github/actions/download-dist
- name: Setup Gradle for dependency-graph generate
uses: ./
with:
gradle-version: 7.0.1
dependency-graph: generate
- name: Run with unsupported Gradle version
working-directory: .github/workflow-samples/groovy-dsl
run: |
if gradle assemble; then
echo "Expected build to fail with Gradle 7.0.1"
exit 1
fi
unsupported-gradle-version-warning:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Download distribution if required
uses: ./.github/actions/download-dist
- name: Setup Gradle for dependency-graph generate
uses: ./
with:
gradle-version: 7.0.1
dependency-graph: generate
- name: Run with unsupported Gradle version
working-directory: .github/workflow-samples/groovy-dsl
run: gradle assemble

insufficient-permissions-failure:
runs-on: ubuntu-latest
permissions:
contents: read
continue-on-error: true
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Download distribution if required
uses: ./.github/actions/download-dist
- name: Setup Gradle for dependency-graph generate
uses: ./
with:
dependency-graph: generate-and-submit
- name: Run with insufficient permissions
working-directory: .github/workflow-samples/groovy-dsl
run: ./gradlew assemble

insufficient-permissions-warning:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Download distribution if required
uses: ./.github/actions/download-dist
- name: Setup Gradle for dependency-graph generate
uses: ./
with:
dependency-graph: generate-and-submit
- name: Run with insufficient permissions
working-directory: .github/workflow-samples/groovy-dsl
run: ./gradlew assemble

0 comments on commit e923b23

Please sign in to comment.