Skip to content

Commit f00f35c

Browse files
Merge pull request #2 from Agaba-derrick/Add-CI
add CI Jobs
2 parents f1e2b97 + 1107c7d commit f00f35c

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Java CI with Maven
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
push:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Java
19+
uses: actions/setup-java@v4
20+
with:
21+
distribution: 'temurin'
22+
java-version: '21'
23+
24+
- name: Build and Test with Maven
25+
run: mvn clean install
26+
27+
- name: Notify on PR creation
28+
if: github.event_name == 'pull_request' && github.event.action == 'opened'
29+
run: |
30+
curl -X POST https://your-api-endpoint.com/notify \
31+
-H "Content-Type: application/json" \
32+
-d '{
33+
"event": "PR_CREATED",
34+
"repo": "${{ github.repository }}",
35+
"url": "${{ github.event.pull_request.html_url }}",
36+
"author": "${{ github.actor }}"
37+
}'
38+
39+
- name: Notify on Build Failure
40+
if: failure()
41+
run: |
42+
curl -X POST https://your-api-endpoint.com/notify \
43+
-H "Content-Type: application/json" \
44+
-d '{
45+
"event": "BUILD_FAILED",
46+
"repo": "${{ github.repository }}",
47+
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
48+
"author": "${{ github.actor }}"
49+
}'

0 commit comments

Comments
 (0)