This repository has been archived by the owner on Jul 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
176 lines (148 loc) · 5.05 KB
/
test.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
---
name: Build
on:
push:
branches:
- main
- ActionsTest
- 'releases/**'
pull_request_target:
branches:
- '**'
permissions: read-all
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha != '' && github.event.pull_request.head.sha || github.sha }}
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Restore Maven cache
uses: skjolber/maven-cache-github-action@v1
with:
step: restore
- name: Maven Build
run: mvn clean package
- name: Maven Validate
run: mvn validate
- name: Maven Test
id: test
run: |
mvn test --file ./pom.xml
mvn jacoco:report-aggregate
- name: Upload current-info
uses: actions/upload-artifact@v3
with:
name: artifacts
path: |
${{ github.workspace }}/coverage/target/site/jacoco-aggregate/jacoco.xml
${{ github.workspace }}/notification-service/target/*.jar
${{ github.workspace }}/workflow-service/target/*.jar
- name: Save Maven cache
uses: skjolber/maven-cache-github-action@v1
with:
step: save
coverage:
runs-on: ubuntu-latest
needs:
- build
permissions:
checks: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: artifacts
- name: "JaCoCo Code Coverage Report ${{ needs.build.outputs.test }}"
id: jacoco_reporter
uses: PavanMudigonda/[email protected]
with:
coverage_results_path: ${{ github.workspace }}/coverage/target/site/jacoco-aggregate/jacoco.xml
coverage_report_name: Coverage
coverage_report_title: Coverage
github_token: ${{ secrets.GITHUB_TOKEN }}
skip_check_run: false
minimum_coverage: 60
fail_below_threshold: false
publish_only_summary: false
- name: Add Coverage Job Summary
run: echo "${{ steps.jacoco_reporter.outputs.coverageSummary }}" >> $GITHUB_STEP_SUMMARY
containers:
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha != '' && github.event.pull_request.head.sha || github.sha }}
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: artifacts
- name: "Build container images to quay ${{ needs.build.outputs.test }}"
run: |
make build-images
- name: Upload image
uses: ishworkh/docker-image-artifact-upload@v1
with:
image: "docker-compose_workflow-service:latest"
- name: Upload image
uses: ishworkh/docker-image-artifact-upload@v1
with:
image: "docker-compose_notification-service:latest"
- name: "finished"
id: container-finished
run: echo 1
integration:
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha != '' && github.event.pull_request.head.sha || github.sha }}
- uses: engineerd/[email protected]
with:
version: "v0.16.0"
- name: Waiting for kind to be ready
run: |
kubectl cluster-info
kubectl get pods -n kube-system
echo "current-context:" $(kubectl config current-context)
echo "environment-kubeconfig:" ${KUBECONFIG}
- name: Install kubernetes dependencies
run: |
make install-kubernetes-dependencies
make wait-kubernetes-dependencies
- id: wait-for-jobs
uses: yogeshlonkar/wait-for-jobs@v0
with:
gh-token: ${{ secrets.GITHUB_TOKEN }}
jobs: |
containers
- name: Download images
uses: ishworkh/docker-image-artifact-download@v1
with:
image: "docker-compose_notification-service:latest"
- name: Download images
uses: ishworkh/docker-image-artifact-download@v1
with:
image: "docker-compose_workflow-service:latest"
- name: Load images inside kind
run: |
make push-images-to-kind
- name: Deploy
run: |
kubectl kustomize hack/manifests/testing| kubectl apply -f -
kubectl wait --timeout=120s --for=condition=Ready pods --all -n default
kubectl get pods --all-namespaces
- name: Run example script
run: |
export SERVERIP=$(kubectl get nodes kind-control-plane -o json | jq -r '[.status.addresses[] | select(.type=="InternalIP")] | .[0].address')
SERVER_IP="${SERVERIP}" SERVERPORT=80 ./workflow-examples/run_examples.sh escalation
SERVER_IP="${SERVERIP}" SERVERPORT=80 ./workflow-examples/run_examples.sh simple
SERVER_IP="${SERVERIP}" SERVERPORT=80 ./workflow-examples/run_examples.sh complex