Skip to content

Commit ac1c83c

Browse files
committed
Implement demo Workflow results
1 parent 2129a0d commit ac1c83c

4 files changed

Lines changed: 49 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Fields to fill in:
4040
- Go to [smee.io](https://smee.io/) and press `Start a new channel`
4141
- Add this link to `Webhook URL`
4242
4. Set up permissions
43+
- `Actions` - `Access: Read and write`
4344
- `Commit statuses` - `Access: Read and write`
4445
- `Contents` - `Access Read-only`
4546
- `Metadata` - `Access: Read-only`
@@ -49,6 +50,7 @@ Fields to fill in:
4950
- `Pull requests`
5051
- `Pull request review`
5152
- `Pull request review comment`
53+
- `Workflow run`
5254
6. Create a private key
5355

5456
After creating the app scroll down and press `Generate a private key`

pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<artifactId>wildfly-github-app</artifactId>
77
<version>1.0.0-SNAPSHOT</version>
88
<properties>
9+
<build-reporter.version>3.7.0</build-reporter.version>
910
<compiler-plugin.version>3.11.0</compiler-plugin.version>
1011
<failsafe.useModulePath>false</failsafe.useModulePath>
1112
<glob.version>0.9.0</glob.version>
@@ -56,6 +57,11 @@
5657
<groupId>io.quarkus</groupId>
5758
<artifactId>quarkus-smallrye-health</artifactId>
5859
</dependency>
60+
<dependency>
61+
<groupId>io.quarkus.bot</groupId>
62+
<artifactId>build-reporter-github-actions</artifactId>
63+
<version>${build-reporter.version}</version>
64+
</dependency>
5965
<dependency>
6066
<groupId>io.quarkus</groupId>
6167
<artifactId>quarkus-junit5</artifactId>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package org.wildfly.bot;
2+
3+
import io.quarkiverse.githubapp.ConfigFile;
4+
import io.quarkiverse.githubapp.event.WorkflowRun;
5+
import io.quarkus.bot.buildreporter.githubactions.BuildReporterConfig;
6+
import io.quarkus.bot.buildreporter.githubactions.BuildReporterEventHandler;
7+
import io.smallrye.graphql.client.dynamic.api.DynamicGraphQLClient;
8+
import jakarta.inject.Inject;
9+
import org.kohsuke.github.GHEventPayload;
10+
import org.kohsuke.github.GitHub;
11+
import org.wildfly.bot.config.WildFlyBotConfig;
12+
import org.wildfly.bot.model.WildFlyConfigFile;
13+
14+
import java.io.IOException;
15+
import java.util.Set;
16+
17+
import static org.wildfly.bot.model.RuntimeConstants.CONFIG_FILE_NAME;
18+
19+
public class AnalyzeWorkflowResults {
20+
@Inject
21+
BuildReporterEventHandler buildReporterEventHandler;
22+
23+
@Inject
24+
WildFlyBotConfig wildFlyBotConfig;
25+
26+
void analyzeWorkflowResults(@WorkflowRun.Completed @WorkflowRun.Requested GHEventPayload.WorkflowRun workflowRunPayload,
27+
@ConfigFile(CONFIG_FILE_NAME) WildFlyConfigFile wildFlyConfigFile,
28+
GitHub gitHub, DynamicGraphQLClient gitHubGraphQLClient) throws IOException {
29+
BuildReporterConfig buildReporterConfig = BuildReporterConfig.builder()
30+
.dryRun(wildFlyBotConfig.isDryRun())
31+
.workflowJobComparator((o1, o2) -> {
32+
return 0;
33+
})
34+
.monitoredWorkflows(Set.of("Java CI with Maven"))
35+
.build();
36+
37+
buildReporterEventHandler.handle(workflowRunPayload, buildReporterConfig, gitHub, gitHubGraphQLClient);
38+
}
39+
}

src/main/resources/application.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ quarkus.openshift.resources.requests.memory=200Mi
66
quarkus.openshift.resources.limits.cpu=200m
77
quarkus.openshift.resources.limits.memory=250Mi
88

9+
quarkus.qute.suffixes=md
10+
quarkus.qute.content-types."md"=text/markdown
911

1012
%test.quarkus.github-app.app-id=0
1113
%test.quarkus.github-app.private-key=-----BEGIN RSA PRIVATE KEY-----\

0 commit comments

Comments
 (0)