Unverified Commit acc77da7 authored by Daz DeBoer's avatar Daz DeBoer
Browse files

Build distribution when running quick-check workflow

The action requires the generated distribution to committed to the 'dist' directory.
During regular development this step causes a number of problems:
- It's easy to forget to add/commit these generated files.
- It's very difficult/impossible to merge/rebase commits that involve generated files
- These file add unnecessary bulk to the git history

With this change, the quick-check workflow will first build the distribution and then
use the generated output for testing. Building and committing these files will only be
required when merging into the 'main' branch.
parent bdb9f7fd
Loading
Loading
Loading
Loading
+16
Changes for .github/actions/build-dist/action.yml: 16 added lines, 0 removed lines.
Original line number Diff line number Diff line
name: 'Build and upload distribution'
# Builds the action distribution an uploads as an artifact for later download
runs:
  using: "composite"
  steps: 
    - name: Build distribution
      shell: bash
      run: |
        npm install
        npm run all
    - name: Upload distribution
      uses: actions/upload-artifact@v2
      with:
        name: dist
        path: dist/
+12
Changes for .github/actions/download-dist/action.yml: 12 added lines, 0 removed lines.
Original line number Diff line number Diff line
name: 'Download dist'
# Downloads a 'dist' directory artifact that was uploaded in an earlier step
# We control this with an environment variable to allow for easier global configuration.
runs:
  using: "composite"
  steps: 
    - name: Download dist
      if: ${{ env.DOWNLOAD_DIST == 'true' }}
      uses: actions/download-artifact@v2
      with:
        name: dist
        path: dist/
−11
Changes for .github/workflows/ci-full-check.yml: 0 added lines, 11 removed lines.
Original line number Diff line number Diff line
@@ -11,64 +11,53 @@ jobs:
    uses: ./.github/workflows/integ-test-action-inputs.yml
    with:
      cache-key-prefix: ${{github.run_number}}-
      runner-os: '["ubuntu-latest", "windows-latest", "macos-latest"]'

  caching-config:
    uses: ./.github/workflows/integ-test-action-inputs-caching.yml
    with:
      cache-key-prefix: ${{github.run_number}}-
      runner-os: '["ubuntu-latest", "windows-latest", "macos-latest"]'

  execution-with-caching:
    uses: ./.github/workflows/integ-test-execution-with-caching.yml
    with:
      cache-key-prefix: ${{github.run_number}}-
      runner-os: '["ubuntu-latest", "windows-latest", "macos-latest"]'

  execution:
    uses: ./.github/workflows/integ-test-execution.yml
    with:
      cache-key-prefix: ${{github.run_number}}-
      runner-os: '["ubuntu-latest", "windows-latest", "macos-latest"]'

  gradle-versions:
    uses: ./.github/workflows/integ-test-gradle-versions.yml
    with:
      cache-key-prefix: ${{github.run_number}}-
      runner-os: '["ubuntu-latest", "windows-latest", "macos-latest"]'

  restore-configuration-cache:
    uses: ./.github/workflows/integ-test-restore-configuration-cache.yml
    with:
      cache-key-prefix: ${{github.run_number}}-
      runner-os: '["ubuntu-latest", "windows-latest", "macos-latest"]'

  restore-custom-gradle-home:
    uses: ./.github/workflows/integ-test-restore-custom-gradle-home.yml
    with:
      cache-key-prefix: ${{github.run_number}}-
      runner-os: '["ubuntu-latest", "windows-latest", "macos-latest"]'

  restore-gradle-home:
    uses: ./.github/workflows/integ-test-restore-gradle-home.yml
    with:
      cache-key-prefix: ${{github.run_number}}-
      runner-os: '["ubuntu-latest", "windows-latest", "macos-latest"]'

  restore-java-toolchain:
    uses: ./.github/workflows/integ-test-restore-java-toolchain.yml
    with:
      cache-key-prefix: ${{github.run_number}}-
      runner-os: '["ubuntu-latest", "windows-latest", "macos-latest"]'

  sample-kotlin-dsl:
    uses: ./.github/workflows/integ-test-sample-kotlin-dsl.yml
    with:
      cache-key-prefix: ${{github.run_number}}-
      runner-os: '["ubuntu-latest", "windows-latest", "macos-latest"]'

  sample-gradle-plugin:
    uses: ./.github/workflows/integ-test-sample-gradle-plugin.yml
    with:
      cache-key-prefix: ${{github.run_number}}-
      runner-os: '["ubuntu-latest", "windows-latest", "macos-latest"]'
+52
Changes for .github/workflows/ci-quick-check.yml: 52 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -6,35 +6,87 @@ on:
  push:

jobs:
  build-distribution:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout sources
      uses: actions/checkout@v2
    - name: Build and upload distribution
      uses: ./.github/actions/build-dist

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

  caching-config:
    needs: build-distribution
    uses: ./.github/workflows/integ-test-action-inputs-caching.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

  gradle-versions:
    needs: build-distribution
    uses: ./.github/workflows/integ-test-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

  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:
    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
+17 −1
Changes for .github/workflows/integ-test-action-inputs-caching.yml: 17 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -7,9 +7,13 @@ on:
        type: string
      runner-os:
        type: string
        default: '["ubuntu-latest"]'
        default: '["ubuntu-latest", "windows-latest", "macos-latest"]'
      download-dist:
        type: boolean
        default: false

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

@@ -22,6 +26,8 @@ jobs:
    steps:
    - name: Checkout sources
      uses: actions/checkout@v2
    - name: Download distribution if required
      uses: ./.github/actions/download-dist
    - name: Setup Gradle
      uses: ./
      with:
@@ -46,6 +52,8 @@ jobs:
    steps:
    - name: Checkout sources
      uses: actions/checkout@v2
    - name: Download distribution if required
      uses: ./.github/actions/download-dist
    - name: Setup Gradle
      uses: ./
      with:
@@ -69,6 +77,8 @@ jobs:
    steps:
    - name: Checkout sources
      uses: actions/checkout@v2
    - name: Download distribution if required
      uses: ./.github/actions/download-dist
    - name: Setup Gradle
      uses: ./
      with:
@@ -90,6 +100,8 @@ jobs:
    steps:
    - name: Checkout sources
      uses: actions/checkout@v2
    - name: Download distribution if required
      uses: ./.github/actions/download-dist
    - name: Create dummy Gradle User Home
      run: mkdir -p ~/.gradle/caches
    - name: Setup Gradle
@@ -116,6 +128,8 @@ jobs:
    steps:
    - name: Checkout sources
      uses: actions/checkout@v2
    - name: Download distribution if required
      uses: ./.github/actions/download-dist
    - name: Setup Gradle
      uses: ./
      with:
@@ -135,6 +149,8 @@ jobs:
    steps:
    - name: Checkout sources
      uses: actions/checkout@v2
    - name: Download distribution if required
      uses: ./.github/actions/download-dist
    - name: Setup Gradle
      uses: ./
      with:
Loading