From 46a7a771e269f933ea911f64f03f1c957430c712 Mon Sep 17 00:00:00 2001 From: Gasper Kojek Date: Mon, 23 Sep 2024 11:18:01 +0200 Subject: [PATCH 1/3] Added a section on using GitHub Actions to run experiments with a private repo --- .github/actions/gradle/README.md | 36 ++++++++++++++++++++++++++++++++ .github/actions/maven/README.md | 35 +++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/.github/actions/gradle/README.md b/.github/actions/gradle/README.md index cb604a81..7e0cfb3d 100644 --- a/.github/actions/gradle/README.md +++ b/.github/actions/gradle/README.md @@ -43,6 +43,42 @@ steps: Once the workflow has been triggered and finishes executing, you can navigate to the workflow's output and investigate the summary produced by the build validation scripts. +#### Usage with private repository + +If the project is a private repository, you can leverage the checkout action to get a local checkout and pass that as the `gitRepo` input to the experiment actions. + +```yaml +name: Run Build Validation Scripts + +on: [ workflow_dispatch ] + +jobs: + validation: + name: Validation + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + path: project-to-validate # check out the project to a subdirectory + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: temurin + - name: Download latest version of the validation scripts + uses: gradle/gradle-enterprise-build-validation-scripts/.github/actions/gradle/download@actions-stable + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Run experiment 3 + uses: gradle/gradle-enterprise-build-validation-scripts/.github/actions/gradle/experiment-3@actions-stable + env: + GRADLE_ENTERPRISE_ACCESS_KEY: "${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}" + with: + gitRepo: "file://$GITHUB_WORKSPACE/project-to-validate" # use the local checkout + tasks: build +``` + ## Configuration cache compatibility Composite actions that will simplify validating Configuration Cache compatibility diff --git a/.github/actions/maven/README.md b/.github/actions/maven/README.md index b598ddbb..287bd31b 100644 --- a/.github/actions/maven/README.md +++ b/.github/actions/maven/README.md @@ -35,3 +35,38 @@ steps: Once the workflow has been triggered and finishes executing, you can navigate to the workflow's output and investigate the summary produced by the build validation scripts. + +#### Usage with private repository + +If the project is a private repository, you can leverage the checkout action to get a local checkout and pass that as the `gitRepo` input to the experiment actions. + +```yaml +name: Run Build Validation Scripts + +on: [ workflow_dispatch ] + +jobs: + validation: + name: Validation + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + path: project-to-validate # check out the project to a subdirectory + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: temurin + - uses: gradle/gradle-enterprise-build-validation-scripts/.github/actions/maven/download@actions-stable + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Run experiment 2 + uses: gradle/gradle-enterprise-build-validation-scripts/.github/actions/maven/experiment-2@actions-stable + env: + GRADLE_ENTERPRISE_ACCESS_KEY: "${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}" + with: + gitRepo: "file://$GITHUB_WORKSPACE/project-to-validate" # use the local checkout + goals: package +``` \ No newline at end of file From 004c507db9b956d1816e89a238a68301f2a6ae58 Mon Sep 17 00:00:00 2001 From: Gasper Kojek Date: Tue, 24 Sep 2024 12:12:55 +0200 Subject: [PATCH 2/3] Applied suggestions from PR comments --- .github/actions/gradle/README.md | 47 +++++++++++--------------------- .github/actions/maven/README.md | 45 ++++++++++-------------------- 2 files changed, 31 insertions(+), 61 deletions(-) diff --git a/.github/actions/gradle/README.md b/.github/actions/gradle/README.md index 7e0cfb3d..9da29b36 100644 --- a/.github/actions/gradle/README.md +++ b/.github/actions/gradle/README.md @@ -43,40 +43,25 @@ steps: Once the workflow has been triggered and finishes executing, you can navigate to the workflow's output and investigate the summary produced by the build validation scripts. -#### Usage with private repository +#### Usage with an authenticated repository -If the project is a private repository, you can leverage the checkout action to get a local checkout and pass that as the `gitRepo` input to the experiment actions. +The first step performed by the Develocity Build Validation Scripts is to clone the repository containing the build to validate. If the repository requires authentication to clone, you can use the [`actions/checkout`](https://github.com/marketplace/actions/checkout) action to perform the clone yourself. You can then configure value of the `gitRepo` input parameter for each experiment to the directory containing the local checkout. ```yaml -name: Run Build Validation Scripts - -on: [ workflow_dispatch ] - -jobs: - validation: - name: Validation - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - path: project-to-validate # check out the project to a subdirectory - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: 17 - distribution: temurin - - name: Download latest version of the validation scripts - uses: gradle/gradle-enterprise-build-validation-scripts/.github/actions/gradle/download@actions-stable - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Run experiment 3 - uses: gradle/gradle-enterprise-build-validation-scripts/.github/actions/gradle/experiment-3@actions-stable - env: - GRADLE_ENTERPRISE_ACCESS_KEY: "${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}" - with: - gitRepo: "file://$GITHUB_WORKSPACE/project-to-validate" # use the local checkout - tasks: build +steps: + - name: Checkout + uses: actions/checkout@v4 + with: + path: project-to-validate # check out the project to a subdirectory + - name: Download latest version of the validation scripts + uses: gradle/gradle-enterprise-build-validation-scripts/.github/actions/gradle/download@actions-stable + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Run experiment 3 + uses: gradle/gradle-enterprise-build-validation-scripts/.github/actions/gradle/experiment-3@actions-stable + with: + gitRepo: "file://$GITHUB_WORKSPACE/project-to-validate" # use the local checkout + tasks: ``` ## Configuration cache compatibility diff --git a/.github/actions/maven/README.md b/.github/actions/maven/README.md index 287bd31b..2d7a0248 100644 --- a/.github/actions/maven/README.md +++ b/.github/actions/maven/README.md @@ -36,37 +36,22 @@ steps: Once the workflow has been triggered and finishes executing, you can navigate to the workflow's output and investigate the summary produced by the build validation scripts. -#### Usage with private repository +#### Usage with an authenticated repository -If the project is a private repository, you can leverage the checkout action to get a local checkout and pass that as the `gitRepo` input to the experiment actions. +The first step performed by the Develocity Build Validation Scripts is to clone the repository containing the build to validate. If the repository requires authentication to clone, you can use the [`actions/checkout`](https://github.com/marketplace/actions/checkout) action to perform the clone yourself. You can then configure value of the `gitRepo` input parameter for each experiment to the directory containing the local checkout. ```yaml -name: Run Build Validation Scripts - -on: [ workflow_dispatch ] - -jobs: - validation: - name: Validation - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - path: project-to-validate # check out the project to a subdirectory - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: 17 - distribution: temurin - - uses: gradle/gradle-enterprise-build-validation-scripts/.github/actions/maven/download@actions-stable - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Run experiment 2 - uses: gradle/gradle-enterprise-build-validation-scripts/.github/actions/maven/experiment-2@actions-stable - env: - GRADLE_ENTERPRISE_ACCESS_KEY: "${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}" - with: - gitRepo: "file://$GITHUB_WORKSPACE/project-to-validate" # use the local checkout - goals: package +steps: + - name: Checkout + uses: actions/checkout@v4 + with: + path: project-to-validate # check out the project to a subdirectory + - uses: gradle/gradle-enterprise-build-validation-scripts/.github/actions/maven/download@actions-stable + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Run experiment 2 + uses: gradle/gradle-enterprise-build-validation-scripts/.github/actions/maven/experiment-2@actions-stable + with: + gitRepo: "file://$GITHUB_WORKSPACE/project-to-validate" # use the local checkout + goals: ``` \ No newline at end of file From dc36464d8298b7213679be9ad57fff095f61f591 Mon Sep 17 00:00:00 2001 From: Eric Haag Date: Tue, 1 Oct 2024 12:14:24 -0500 Subject: [PATCH 3/3] Adjust wording --- .github/actions/gradle/README.md | 10 ++++++---- .github/actions/maven/README.md | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/actions/gradle/README.md b/.github/actions/gradle/README.md index 9da29b36..efbbd5ea 100644 --- a/.github/actions/gradle/README.md +++ b/.github/actions/gradle/README.md @@ -43,16 +43,18 @@ steps: Once the workflow has been triggered and finishes executing, you can navigate to the workflow's output and investigate the summary produced by the build validation scripts. -#### Usage with an authenticated repository +#### Usage with a private repository -The first step performed by the Develocity Build Validation Scripts is to clone the repository containing the build to validate. If the repository requires authentication to clone, you can use the [`actions/checkout`](https://github.com/marketplace/actions/checkout) action to perform the clone yourself. You can then configure value of the `gitRepo` input parameter for each experiment to the directory containing the local checkout. +The first step of each experiment is to clone the repository containing the build to validate. +If your repository requires authentication to clone, such as a private repository, you can use the [`actions/checkout`](https://github.com/marketplace/actions/checkout) action to perform the clone instead, as it supports cloning from repositories requiring authentication. +You can then configure value of the `gitRepo` input parameter to the directory containing the local checkout. ```yaml steps: - name: Checkout uses: actions/checkout@v4 with: - path: project-to-validate # check out the project to a subdirectory + path: project-to-validate # Check out the project to a directory named 'project-to-validate' - name: Download latest version of the validation scripts uses: gradle/gradle-enterprise-build-validation-scripts/.github/actions/gradle/download@actions-stable with: @@ -60,7 +62,7 @@ steps: - name: Run experiment 3 uses: gradle/gradle-enterprise-build-validation-scripts/.github/actions/gradle/experiment-3@actions-stable with: - gitRepo: "file://$GITHUB_WORKSPACE/project-to-validate" # use the local checkout + gitRepo: "file://$GITHUB_WORKSPACE/project-to-validate" # Use 'project-to-validate' for the experiment tasks: ``` diff --git a/.github/actions/maven/README.md b/.github/actions/maven/README.md index 2d7a0248..4ed62d98 100644 --- a/.github/actions/maven/README.md +++ b/.github/actions/maven/README.md @@ -36,22 +36,24 @@ steps: Once the workflow has been triggered and finishes executing, you can navigate to the workflow's output and investigate the summary produced by the build validation scripts. -#### Usage with an authenticated repository +#### Usage with a private repository -The first step performed by the Develocity Build Validation Scripts is to clone the repository containing the build to validate. If the repository requires authentication to clone, you can use the [`actions/checkout`](https://github.com/marketplace/actions/checkout) action to perform the clone yourself. You can then configure value of the `gitRepo` input parameter for each experiment to the directory containing the local checkout. +The first step of each experiment is to clone the repository containing the build to validate. +If your repository requires authentication to clone, such as a private repository, you can use the [`actions/checkout`](https://github.com/marketplace/actions/checkout) action to perform the clone instead, as it supports cloning from repositories requiring authentication. +You can then configure value of the `gitRepo` input parameter to the directory containing the local checkout. ```yaml steps: - name: Checkout uses: actions/checkout@v4 with: - path: project-to-validate # check out the project to a subdirectory + path: project-to-validate # Check out the project to a directory named 'project-to-validate' - uses: gradle/gradle-enterprise-build-validation-scripts/.github/actions/maven/download@actions-stable with: token: ${{ secrets.GITHUB_TOKEN }} - name: Run experiment 2 uses: gradle/gradle-enterprise-build-validation-scripts/.github/actions/maven/experiment-2@actions-stable with: - gitRepo: "file://$GITHUB_WORKSPACE/project-to-validate" # use the local checkout + gitRepo: "file://$GITHUB_WORKSPACE/project-to-validate" # Use 'project-to-validate' for the experiment goals: ``` \ No newline at end of file