Unverified Commit 4ca49686 authored by Daz DeBoer's avatar Daz DeBoer
Browse files

Add test for action in containerized runner

parent fd188269
Loading
Loading
Loading
Loading
+5
Changes for .github/workflows/ci-full-check.yml: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -48,6 +48,11 @@ jobs:
    with:
      cache-key-prefix: ${{github.run_number}}-

  restore-containerized-gradle-home:
    uses: ./.github/workflows/integ-test-restore-containerized-gradle-home.yml
    with:
      cache-key-prefix: ${{github.run_number}}-

  restore-gradle-home:
    uses: ./.github/workflows/integ-test-restore-gradle-home.yml
    with:
+6 −1
Changes for .github/workflows/ci-quick-check.yml: 6 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -55,11 +55,16 @@ jobs:
      runner-os: '["ubuntu-latest"]'
      download-dist: true

  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:
      runner-os: '["ubuntu-latest"]'
      download-dist: true

  restore-gradle-home:
+60
Changes for .github/workflows/integ-test-restore-containerized-gradle-home.yml: 60 added lines, 0 removed lines.
Original line number Diff line number Diff line
name: Test restore custom Gradle Home

on:
  workflow_call:
    inputs:
      cache-key-prefix:
        type: string
      download-dist:
        type: boolean
        default: false

env:
  DOWNLOAD_DIST: ${{ inputs.download-dist }}
  GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: restore-custom-gradle-home-${{ inputs.cache-key-prefix }}
  GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true

jobs:
  seed-build:
    runs-on: ubuntu-latest
    container: fedora:latest
    steps:
    - name: Checkout sources
      uses: actions/checkout@v3
    - name: Download distribution if required
      uses: ./.github/actions/download-dist
    - name: Setup Java
      uses: actions/setup-java@v3
      with:
        java-version: 11
        distribution: temurin
    - name: Setup Gradle
      uses: ./
      with:
        cache-read-only: false # For testing, allow writing cache entries on non-default branches
    - name: Build using Gradle wrapper
      working-directory: .github/workflow-samples/groovy-dsl
      run: ./gradlew test

  # Test that the gradle-user-home cache will cache dependencies, by running build with --offline
  dependencies-cache:
    needs: seed-build
    runs-on: ubuntu-latest
    container: fedora:latest
    steps:
    - name: Checkout sources
      uses: actions/checkout@v3
    - name: Download distribution if required
      uses: ./.github/actions/download-dist
    - name: Setup Java
      uses: actions/setup-java@v3
      with:
        java-version: 11
        distribution: temurin
    - name: Setup Gradle
      uses: ./
      with:
        cache-read-only: true
    - name: Execute Gradle build with --offline
      working-directory: .github/workflow-samples/groovy-dsl
      run: ./gradlew test --offline
 No newline at end of file
+3 −15
Changes for .github/workflows/integ-test-restore-custom-gradle-home.yml: 3 added lines, 15 removed lines.
Original line number Diff line number Diff line
@@ -5,9 +5,6 @@ on:
    inputs:
      cache-key-prefix:
        type: string
      runner-os:
        type: string
        default: '["ubuntu-latest", "windows-latest", "macos-latest"]'
      download-dist:
        type: boolean
        default: false
@@ -19,10 +16,7 @@ env:

jobs:
  seed-build:
    strategy:
      matrix:
        os: ${{fromJSON(inputs.runner-os)}}
    runs-on: ${{ matrix.os }}
    runs-on: ubuntu-latest
    steps:
    - name: Set Gradle User Home
      run: |
@@ -43,10 +37,7 @@ jobs:
  # Test that the gradle-user-home cache will cache dependencies, by running build with --offline
  dependencies-cache:
    needs: seed-build
    strategy:
      matrix:
        os: ${{fromJSON(inputs.runner-os)}}
    runs-on: ${{ matrix.os }}
    runs-on: ubuntu-latest
    steps:
    - name: Set Gradle User Home
      run: |
@@ -67,10 +58,7 @@ jobs:
  # Test that the gradle-user-home cache will cache and restore local build-cache
  build-cache:
    needs: seed-build
    strategy:
      matrix:
        os: ${{fromJSON(inputs.runner-os)}}
    runs-on: ${{ matrix.os }}
    runs-on: ubuntu-latest
    steps:
    - name: Set Gradle User Home
      run: |