-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (61 loc) · 2.3 KB
/
JavaCIwithMaven.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: JavaCIwithMaven
#Run build within each push of code to master branch
on:
[push]
#branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 20
uses: actions/setup-java@v3
with:
java-version: '20'
distribution: 'adopt'
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
# Make directory to upload the test results
- name: Make Directory for results
run: mkdir -p testResults
- name: MVN install
run: mvn install
- name: Run mvn test
run: mvn test
- name: Build with Maven
run: mvn verify -B -e --file pom.xml
#run: mvn -q -B -DskipTests package --file pom.xml
#Run test group
- name: Run E2E Tests
run: mvn -q -B test -Dgroups="Test"
#Verify and run tests tag
- name: Verify and run
run: mvn test verify -Dcucumber.options="--tags @Test"
# - name: Build with Maven
# run: mvn --batch-mode --update-snapshots package
# - name: Run the Maven verify phase
# run: mvn --batch-mode --update-snapshots verify
# - name: Install dependencies
# run: mvn verify -B --file pom.xml
#Dependencies
#- name: Install dependencies
# run: mvn test -B -e package --file pom.xml
#Create and output results
#The reports land in actions tab > summary > Artifacts
#- name: Output the run Details
# uses: actions/upload-artifact@v2
# with:
# name: RunReports
# path: testResults
#- name: Run restAssured swapi
# run: mvn -q -B test -Dgroups="restAssuredSwapi"