Unverified Commit 6a8b99d4 authored by Daz DeBoer's avatar Daz DeBoer Committed by GitHub
Browse files

Improve GHA workflows (#148)

A bunch of improvements to the GHA workflow pipeline including:
- Separate workflow for unit tests
- Always use a locally-built dist directory for integ-tests
- Only run 'quick' integ-tests for non-PR commits. Once a PR is submitted, the 'full' suite will be run on each push.
parents 63fcfbfe 153b1135
Loading
Loading
Loading
Loading
+2
Changes for .github/actions/build-dist/action.yml: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -6,6 +6,8 @@ runs:
    - uses: actions/setup-node@v4
      with:
        node-version: 20
        cache: npm
        cache-dependency-path: sources/package-lock.json
    - name: Build distribution
      shell: bash
      run: |
+1 −3
Changes for .github/actions/init-integ-test/action.yml: 1 added line, 3 removed lines.
Original line number Diff line number Diff line
@@ -9,10 +9,8 @@ runs:
        distribution: 'temurin'
        java-version: 11

    # 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.
    # Downloads a 'dist' directory artifact that was uploaded in an earlier 'build-dist' step
    - name: Download dist
      if: ${{ env.DOWNLOAD_DIST == 'true' }}
      uses: actions/download-artifact@v4
      with:
        name: dist
+30
Changes for .github/workflows/ci-check-and-unit-test.yml: 30 added lines, 0 removed lines.
Original line number Diff line number Diff line
name: CI-check-and-unit-test

on:
  push:

permissions:
  contents: read

jobs:
  check-format-and-unit-test:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout sources
      uses: actions/checkout@v4
    - uses: actions/setup-node@v4
      with:
        node-version: 20
        cache: npm
        cache-dependency-path: sources/package-lock.json

    - name: Check formatting and compile
      run: |
        npm install
        npm run check
        npm run compile
      working-directory: sources
    - name: Run unit tests
      run: |
        npm test
      working-directory: sources
−28

File deleted.

+33 −8
Changes for .github/workflows/ci-integ-test-full.yml: 33 added lines, 8 removed lines.
Original line number Diff line number Diff line
name: CI-full-check
name: CI-integ-test-full

on:
  workflow_dispatch:
  pull_request:
    types:
      - assigned
      - review_requested
  push:
    branches: 
      - main
      - release/**
    paths:
      - '.github/**'
      - 'dist/**'
      - '**/action.yml'

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

  action-inputs:
    needs: build-distribution
    uses: ./.github/workflows/integ-test-action-inputs.yml
    with:
      cache-key-prefix: ${{github.run_number}}-

  build-scan-publish:
    needs: build-distribution
    uses: ./.github/workflows/integ-test-build-scan-publish.yml
    with:
      cache-key-prefix: ${{github.run_number}}-

  cache-cleanup:
    needs: build-distribution
    uses: ./.github/workflows/integ-test-cache-cleanup.yml
    with:
      cache-key-prefix: ${{github.run_number}}-

  caching-config:
    needs: build-distribution
    uses: ./.github/workflows/integ-test-caching-config.yml
    with:
      cache-key-prefix: ${{github.run_number}}-

  dependency-graph:
    needs: build-distribution
    uses: ./.github/workflows/integ-test-dependency-graph.yml
    permissions:
      contents: write
@@ -39,6 +50,7 @@ jobs:
      cache-key-prefix: ${{github.run_number}}-

  dependency-submission:
    needs: build-distribution
    uses: ./.github/workflows/integ-test-dependency-submission.yml
    permissions:
      contents: write
@@ -46,21 +58,25 @@ jobs:
      cache-key-prefix: ${{github.run_number}}-

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

  execution-with-caching:
    needs: build-distribution
    uses: ./.github/workflows/integ-test-execution-with-caching.yml
    with:
      cache-key-prefix: ${{github.run_number}}-

  execution:
    needs: build-distribution
    uses: ./.github/workflows/integ-test-execution.yml
    with:
      cache-key-prefix: ${{github.run_number}}-

  develocity-injection:
    needs: build-distribution
    uses: ./.github/workflows/integ-test-inject-develocity.yml
    with:
      cache-key-prefix: ${{github.run_number}}-
@@ -68,11 +84,13 @@ jobs:
      DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_SOLUTIONS_ACCESS_TOKEN }}

  provision-gradle-versions:
    needs: build-distribution
    uses: ./.github/workflows/integ-test-provision-gradle-versions.yml
    with:
      cache-key-prefix: ${{github.run_number}}-

  restore-configuration-cache:
    needs: build-distribution
    uses: ./.github/workflows/integ-test-restore-configuration-cache.yml
    with:
      cache-key-prefix: ${{github.run_number}}-
@@ -80,36 +98,43 @@ jobs:
      GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }}

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

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

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

  restore-java-toolchain:
    needs: build-distribution
    uses: ./.github/workflows/integ-test-restore-java-toolchain.yml
    with:
      cache-key-prefix: ${{github.run_number}}-

  sample-kotlin-dsl:
    needs: build-distribution
    uses: ./.github/workflows/integ-test-sample-kotlin-dsl.yml
    with:
      cache-key-prefix: ${{github.run_number}}-

  sample-gradle-plugin:
    needs: build-distribution
    uses: ./.github/workflows/integ-test-sample-gradle-plugin.yml
    with:
      cache-key-prefix: ${{github.run_number}}-

  toolchain-detection:
    needs: build-distribution
    uses: ./.github/workflows/integ-test-detect-java-toolchains.yml
    with:
      cache-key-prefix: ${{github.run_number}}-
Loading