Skip to content

Commit

Permalink
Add PR test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jprinet committed Jan 26, 2024
1 parent 0fb0353 commit 3ee87f3
Show file tree
Hide file tree
Showing 10 changed files with 238,571 additions and 60,669 deletions.
70 changes: 67 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,84 @@ on:
- 'releases/*'

jobs:

build:
runs-on: ubuntu-latest
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install Dependencies
id: npm-ci
run: npm ci
- name: Build
run: npm run all

test-capture:
runs-on: ubuntu-latest
if: "github.event_name == 'pull_request'"
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout Maven sample project
uses: actions/checkout@v4
with:
repository: 'gradle/develocity-build-config-samples'
path: 'sample'
ref: 'main'
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
- name: Setup Maven Build Scan dump capture
uses: ./build-scan-setup-maven
- name: Run Maven Build 1
working-directory: ./sample/common-develocity-maven-configuration
run: mvn clean -B -X -Dgradle.enterprise.url=https://ge.solutions-team.gradle.com
- name: Run Maven Build 2
working-directory: ./sample/common-develocity-maven-configuration
run: mvn initialize -B -X -Dgradle.enterprise.url=https://ge.solutions-team.gradle.com

test-publish:
runs-on: ubuntu-latest
if: "github.event_name == 'pull_request'"
needs: test-capture
permissions:
actions: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Build Scan link capture
uses: ./build-scan-setup-maven
- name: Publish Build Scans
uses: ./build-scan-publish-maven
with:
develocity-url: 'https://ge.solutions-team.gradle.com/'
develocity-access-key: 'foo'

assert-summary:
runs-on: ubuntu-latest
if: "github.event_name == 'pull_request'"
needs: test-publish
steps:
- name: Find Comment
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ github.event.number }}
body-includes: '###### Generated by gradle/github-actions'
- name: Assert PR has been commented with publication summary
run: |
if [[ -z "${{ steps.fc.outputs.comment-id }}" ]]; then
echo "Expected comment not found"
exit 1
else
echo "Removing expected comment"
gh api --method DELETE "repos/${GITHUB_REPOSITORY}/issues/comments/${{ steps.fc.outputs.comment-id }}"
fi
Loading

0 comments on commit 3ee87f3

Please sign in to comment.