From 7afbdddd1084f553e1dd86e0182ff3f3591c7510 Mon Sep 17 00:00:00 2001 From: abilan Date: Thu, 25 May 2023 16:11:29 -0400 Subject: [PATCH 1/2] Migrate building PRs to GitHub Action See gh-345 --- .github/workflows/pr-build-workflow.yml | 23 +++++++++++++ ci/pipeline.yml | 44 ------------------------- 2 files changed, 23 insertions(+), 44 deletions(-) create mode 100644 .github/workflows/pr-build-workflow.yml diff --git a/.github/workflows/pr-build-workflow.yml b/.github/workflows/pr-build-workflow.yml new file mode 100644 index 0000000..80fd7ff --- /dev/null +++ b/.github/workflows/pr-build-workflow.yml @@ -0,0 +1,23 @@ +name: Pull Request build + +on: + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + + - uses: actions/checkout@v3 + + - name: Set up JDK + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: 17 + + - name: Build with Maven + run: mvnw --batch-mode --update-snapshots verify diff --git a/ci/pipeline.yml b/ci/pipeline.yml index 633b94d..a9752f0 100644 --- a/ci/pipeline.yml +++ b/ci/pipeline.yml @@ -41,13 +41,6 @@ resource_types: tag: 0.0.18 username: ((docker-hub-username)) password: ((docker-hub-password)) -- name: pull-request - type: registry-image - source: - repository: teliaoss/github-pr-resource - tag: v0.23.0 - username: ((docker-hub-username)) - password: ((docker-hub-password)) - name: github-release type: registry-image source: @@ -68,14 +61,6 @@ resources: icon: github source: <<: *git-repo-resource-source -- name: git-pull-request - type: pull-request - icon: source-pull - source: - access_token: ((github-ci-pull-request-token)) - repository: ((github-repo-name)) - base_branch: ((branch)) - ignore_paths: ["ci/*"] - name: github-pre-release type: github-release icon: briefcase-download-outline @@ -163,33 +148,6 @@ jobs: - put: artifactory-repo params: <<: *artifactory-repo-put-params -- name: build-pull-requests - serial: true - public: true - plan: - - get: ci-image - - get: git-repo - resource: git-pull-request - trigger: true - version: every - - do: - - put: git-pull-request - params: - path: git-repo - status: pending - - task: build-project - image: ci-image - file: git-repo/ci/tasks/build-pr-project.yml - on_success: - put: git-pull-request - params: - path: git-repo - status: success - on_failure: - put: git-pull-request - params: - path: git-repo - status: failure - name: stage-milestone serial: true plan: @@ -353,5 +311,3 @@ groups: jobs: ["stage-milestone", "stage-rc", "stage-release", "promote-milestone", "promote-rc", "promote-release", "create-github-release"] - name: "ci-images" jobs: ["build-ci-image"] -- name: "pull-requests" - jobs: ["build-pull-requests"] From 24674edbc5a682d889308e4b1ceaa55c09739d5f Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Fri, 26 May 2023 08:53:46 +0200 Subject: [PATCH 2/2] Polish "Migrate building PRs to GitHub Action" See gh-345 --- .github/workflows/pr-build-workflow.yml | 28 ++++++++++++------------- ci/tasks/build-pr-project.yml | 10 --------- 2 files changed, 14 insertions(+), 24 deletions(-) delete mode 100644 ci/tasks/build-pr-project.yml diff --git a/.github/workflows/pr-build-workflow.yml b/.github/workflows/pr-build-workflow.yml index 80fd7ff..995b41c 100644 --- a/.github/workflows/pr-build-workflow.yml +++ b/.github/workflows/pr-build-workflow.yml @@ -1,23 +1,23 @@ -name: Pull Request build +name: Build Pull Request +on: pull_request -on: - pull_request: - branches: [ main ] +permissions: + contents: read jobs: build: - + name: Build pull request runs-on: ubuntu-latest - + if: ${{ github.repository == 'spring-projects/spring-retry' }} steps: - - - uses: actions/checkout@v3 - - - name: Set up JDK + - name: Set up JDK 17 uses: actions/setup-java@v3 with: - distribution: 'temurin' - java-version: 17 + java-version: '17' + distribution: 'liberica' - - name: Build with Maven - run: mvnw --batch-mode --update-snapshots verify + - name: Check out code + uses: actions/checkout@v3 + + - name: Build + run: ./mvnw --batch-mode --update-snapshots verify diff --git a/ci/tasks/build-pr-project.yml b/ci/tasks/build-pr-project.yml deleted file mode 100644 index f5c7fc2..0000000 --- a/ci/tasks/build-pr-project.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -platform: linux -inputs: -- name: git-repo -outputs: -- name: distribution-repository -caches: -- path: maven -run: - path: git-repo/ci/scripts/build-project.sh \ No newline at end of file