Skip to content

Commit a41e9a4

Browse files
created maven workflow file for githubactions (#7)
* created maven workflow file for githubactions * updated test report config for maven workflow * updated maven workflow file * command updated to skip tests while building project, updated test suite file path for test reporter * added permission block in maven workflow for test reporterto work
1 parent 26f5dcb commit a41e9a4

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

.github/workflows/maven.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Java CI with Maven
10+
11+
on:
12+
push:
13+
branches:
14+
- master
15+
- issue-*
16+
17+
permissions:
18+
statuses: write
19+
checks: write
20+
contents: write
21+
pull-requests: write
22+
23+
jobs:
24+
build:
25+
name: Build and Test
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- uses: actions/checkout@v3
30+
- name: Set up JDK 11
31+
uses: actions/setup-java@v3
32+
with:
33+
java-version: '11'
34+
distribution: 'temurin'
35+
cache: maven
36+
37+
- name: Start restful booker service
38+
run: docker-compose -f ./docker-compose-restfulbooker.yml up -d
39+
40+
- name: Build Project
41+
run: mvn clean install -DskipTests
42+
43+
- name: Run tests
44+
run: mvn clean test
45+
46+
- name: Stop restful booker service
47+
run: docker-compose -f ./docker-compose-restfulbooker.yml down --remove-orphans
48+
49+
- name: Test Reporter
50+
uses: dorny/test-reporter@v1.6.0
51+
if: always()
52+
with:
53+
name: Test Results
54+
path: target/surefire-reports/TEST-TestSuite.xml
55+
reporter: java-junit

0 commit comments

Comments
 (0)