-
Notifications
You must be signed in to change notification settings - Fork 6
97 lines (97 loc) · 3.27 KB
/
push.yaml
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
name: "Push Build"
on:
workflow_dispatch:
push:
branches:
- main
paths-ignore:
- '**/README.md'
- '.github/project.yml'
jobs:
linux-build-jvm:
name: Linux - JVM build
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 17 ]
steps:
- uses: actions/checkout@v3
- name: Check dead links in documentation
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: 'yes'
config-file: '.github/markdown-link-check.json'
- name: Reclaim Disk Space
run: .github/ci-prerequisites.sh
- name: Kubernetes KinD Cluster
uses: container-tools/kind-action@v2
with:
version: v0.11.1
registry: true
- name: Install OPM and Operator SDK tool
uses: redhat-actions/openshift-tools-installer@v1
with:
source: "github"
opm: "latest"
operator-sdk: "latest"
- name: Install Operator Lifecycle Manager and Operator SDK into Kind
run: operator-sdk olm install --version v0.23.0
- name: Install JDK {{ matrix.java }}
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
check-latest: true
cache: 'maven'
- name: Build
run: |
mvn -s .github/mvn-settings.xml clean install -Pframework -Dexamples -Dcoverage -Dvalidate-format \
-Dts.services.all.image.registry=$KIND_REGISTRY \
-Denvironment.ci=true \
-Dexclude.kubernetes.tests=no
- name: Generate Jacoco Report
run: |
cd coverage-report
mvn package
- name: Generate Jacoco Badge
id: jacoco
uses: cicirello/jacoco-badge-generator@v2
with:
jacoco-csv-file: coverage-report/target/site/jacoco/jacoco.csv
- name: Coverage Preparation
id: coverage
run: |
echo "coverage = ${{ steps.jacoco.outputs.coverage }}"
if [[ `git status | grep .svg | wc -l` > 0 ]]; then
echo ::set-output name=needs-commit-badge::true
else
echo ::set-output name=needs-commit-badge::false
fi
- name: Commit the badge (if it changed)
if: steps.coverage.outputs.needs-commit-badge == 'true'
run: |
git config --global user.name 'snowdrop'
git config --global user.email '[email protected]'
git add *.svg
git commit -m "Autogenerated JaCoCo coverage badge"
- name: Push the badge (if it changed)
if: steps.coverage.outputs.needs-commit-badge == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
force: true
- name: Zip Artifacts
if: failure()
run: |
zip -R artifacts-latest-linux-jvm${{ matrix.java }}.zip '*-reports/*'
- name: Archive artifacts
if: failure()
uses: actions/upload-artifact@v3
with:
name: ci-artifacts
path: artifacts-latest-linux-jvm${{ matrix.java }}.zip
- name: Archive Coverage Report
uses: actions/upload-artifact@v3
with:
name: ci-coverage
path: coverage-report/target/site/jacoco