-
Notifications
You must be signed in to change notification settings - Fork 0
119 lines (107 loc) · 3.33 KB
/
CICD_Main_Pipeline.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Bukd & Test in DevVer and SIT
env:
ACTIONS_STEP_DEBUG: true
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
jobs:
DevVer:
runs-on: [self-hosted]
strategy:
matrix:
browser: [ chrome ]
steps:
- uses: actions/checkout@v4
- name: Cache JDK
uses: actions/[email protected]
with:
path: |
~/jdk
key: ${{ runner.os }}-jdk19-${{ hashFiles('**/pom.xml') }}
- name: Start timing
run: echo "START_TIME=$(date +%s)" >> $GITHUB_ENV
- name: Set up JDK 19
uses: actions/setup-java@v4
with:
java-version: '19'
distribution: 'temurin'
cache: maven
- name: End timing
run: |
END_TIME=$(date +%s)
echo "Process took $((END_TIME - START_TIME)) seconds to complete"
- name: Start timing
run: echo "START_TIME=$(date +%s)" >> $GITHUB_ENV
- name: Build & Test DevVer with Maven
run: mvn -B package --file UTpom.xml -Denvironment=DevVer -Dbrowser=${{ matrix.browser }}
- name: End timing
run: |
END_TIME=$(date +%s)
echo "Process took $((END_TIME - START_TIME)) seconds to complete"
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: DevVer test results ${{ matrix.browser }} - ${{ github.run_id }}
path: target/surefire-reports/
DevInt:
runs-on: [self-hosted]
needs: DevVer
strategy:
matrix:
browser: [ chrome, firefox ]
steps:
- uses: actions/checkout@v4
- name: Set up JDK 19
uses: actions/setup-java@v4
with:
java-version: '19'
distribution: 'temurin'
cache: maven
- name: Build & Test DevInt with Maven
run: mvn -B package --file pom.xml -Denvironment=DevInt -Dbrowser=${{ matrix.browser }}
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: DevInt test results ${{ matrix.browser }} - ${{ github.run_id }}
path: target/surefire-reports/
SIT:
runs-on: [self-hosted]
needs: DevInt
strategy:
matrix:
browser: [chrome,firefox]
steps:
- uses: actions/checkout@v4
- name: Set up JDK 19
uses: actions/setup-java@v4
with:
java-version: '19'
distribution: 'temurin'
cache: maven
- name: Build & test SIT with Maven
run: mvn -B package --file pom.xml -Denvironment=SIT -Dbrowser=${{ matrix.browser }}
# - name: Remove remove previous Docker DevInt container instance
# run: docker rm -f SIT
# - name: Build Docker image
# run: docker build . --file Dockerfile_SIT --tag cicd_project_image:SIT
# - name: Run docker image
# run: docker run --name SIT cicd_project_image:SIT
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: SIT test results ${{ matrix.browser }} - ${{ github.run_id }}
path: target/surefire-reports/
Production:
runs-on: [self-hosted]
needs: SIT
steps:
- uses: actions/checkout@v4
- name: Set up JDK 19
uses: actions/setup-java@v4
with:
java-version: '19'
distribution: 'temurin'
cache: maven