Skip to content

Commit 8aa4936

Browse files
authored
Create build-and-test.yml that is executed via PR comment
1 parent 3fd7d80 commit 8aa4936

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build and Test from PR Comment
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
jobs:
8+
build-and-test:
9+
if: |
10+
github.event.issue.pull_request
11+
&& startsWith(github.event.comment.body, '/run-tests')
12+
&& (github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'MEMBER')
13+
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout PR Head
18+
uses: actions/checkout@v4
19+
with:
20+
ref: ${{ github.event.pull_request.head.sha }}
21+
22+
- name: Set up JDK 17
23+
uses: actions/setup-java@v4
24+
with:
25+
java-version: '17'
26+
distribution: 'temurin'
27+
cache: maven
28+
29+
- name: maven-settings-action
30+
if: false # deactivated for fork testing
31+
uses: s4u/maven-settings-action@894661b3ddae382f1ae8edbeab60987e08cf0788 # commit hash references to v4.0.0
32+
with:
33+
servers: '[{"id": "mulesoft-ee-releases", "username": "${env.MULE_REPO_USER}", "password": "${env.MULE_REPO_PASSWORD}"}]'
34+
repositories: '[{"id": "mulesoft-ee-releases", "name": "MuleSoft EE Releases", "url": "https://repository.mulesoft.org/nexus-ee/content/repositories/releases-ee/"}]'
35+
36+
# commented out for fork testing
37+
# - name: Build and test
38+
# env:
39+
# MULE_REPO_USER: ${{ secrets.MULE_REPO_USER }}
40+
# MULE_REPO_PASSWORD: ${{ secrets.MULE_REPO_PASSWORD }}
41+
# run: mvn -B verify
42+
43+
- name: Build only (during fork testing)
44+
run: mvn -B clean install -DskipTests

0 commit comments

Comments
 (0)