Skip to content

Commit 166baf7

Browse files
committed
Merge branch 'develop' into update-from-template-github_com_xdev-software_standard-maven-template_master-merged
2 parents 2e29c7a + 69446bf commit 166baf7

File tree

326 files changed

+42411
-164
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

326 files changed

+42411
-164
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ body:
1515
attributes:
1616
label: "Checklist"
1717
options:
18-
- label: "I am able to reproduce the bug with the [latest version](https://github.com/xdev-software/template-placeholder/releases/latest)"
18+
- label: "I am able to reproduce the bug with the [latest version](https://github.com/xdev-software/mockserver-neolight/releases/latest)"
1919
required: true
20-
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
20+
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/mockserver-neolight/issues) or [closed](https://github.com/xdev-software/mockserver-neolight/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
2121
required: true
2222
- label: "I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise."
2323
required: true

.github/ISSUE_TEMPLATE/enhancement.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ body:
1313
attributes:
1414
label: "Checklist"
1515
options:
16-
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
16+
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/mockserver-neolight/issues) or [closed](https://github.com/xdev-software/mockserver-neolight/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
1717
required: true
1818
- label: "I have taken the time to fill in all the required details. I understand that the feature request will be dismissed otherwise."
1919
required: true

.github/ISSUE_TEMPLATE/question.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ body:
1212
attributes:
1313
label: "Checklist"
1414
options:
15-
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
15+
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/mockserver-neolight/issues) or [closed](https://github.com/xdev-software/mockserver-neolight/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
1616
required: true
1717
- label: "I have taken the time to fill in all the required details. I understand that the question will be dismissed otherwise."
1818
required: true

.github/workflows/check-build.yml

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ on:
1919
- '.idea/**'
2020
- 'assets/**'
2121

22-
env:
23-
DEMO_MAVEN_MODULE: ${{ github.event.repository.name }}-demo
24-
2522
jobs:
2623
build:
2724
runs-on: ubuntu-latest
@@ -48,7 +45,7 @@ jobs:
4845
${{ runner.os }}-mvn-build-
4946
5047
- name: Build with Maven
51-
run: ./mvnw -B clean package
48+
run: ./mvnw -B clean package -T2C
5249

5350
- name: Check for uncommited changes
5451
run: |
@@ -68,13 +65,44 @@ jobs:
6865
exit 1
6966
fi
7067
71-
- name: Upload demo files
68+
- name: Upload standalone server JAR
7269
uses: actions/upload-artifact@v7
7370
with:
74-
name: demo-files-java-${{ matrix.java }}
75-
path: ${{ env.DEMO_MAVEN_MODULE }}/target/${{ env.DEMO_MAVEN_MODULE }}.jar
71+
name: server-${{ matrix.java }}
72+
path: server/target/server-standalone.jar
7673
if-no-files-found: error
7774

75+
# Build docker
76+
- uses: docker/setup-qemu-action@v4
77+
78+
- uses: docker/setup-buildx-action@v4
79+
80+
- uses: docker/build-push-action@v7
81+
with:
82+
context: ./server
83+
push: false
84+
tags: mockserver-standalone:experimental
85+
platforms: linux/amd64,linux/arm64
86+
cache-from: type=gha,scope=build
87+
cache-to: type=gha,mode=max,scope=build
88+
89+
# 2 steps required because "failed to build: docker exporter does not currently support exporting manifest lists"
90+
- uses: docker/build-push-action@v7
91+
with:
92+
context: ./server
93+
push: false
94+
load: true
95+
tags: mockserver-standalone:experimental
96+
cache-from: type=gha,scope=build-for-it
97+
cache-to: type=gha,mode=max,scope=build-for-it
98+
99+
- name: Run integration tests
100+
run: |
101+
./mvnw -B test \
102+
-P run-integration-tests \
103+
-T2C \
104+
-Dmockserver-image=mockserver-standalone:experimental
105+
78106
checkstyle:
79107
runs-on: ubuntu-latest
80108
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}
@@ -148,7 +176,8 @@ jobs:
148176
run: ./mvnw -B test pmd:aggregate-pmd-no-fork pmd:check -P pmd -DskipTests -T2C
149177

150178
- name: Run CPD (Copy Paste Detector)
151-
run: ./mvnw -B pmd:aggregate-cpd pmd:cpd-check -P pmd -DskipTests -T2C
179+
# Todo: Readd pmd:cpd-check - Disabled for now due to upstream code
180+
run: ./mvnw -B pmd:aggregate-cpd -P pmd -DskipTests -T2C
152181

153182
- name: Upload report
154183
if: ${{ !cancelled() }}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Image vuln scan
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "22 7 * * 0"
7+
8+
permissions:
9+
issues: write
10+
11+
env:
12+
# Note: Use ghcr since we have no rate limiting there
13+
TRIVYY_IMAGE_REF: 'ghcr.io/xdev-software/mockserver-neolight:latest'
14+
15+
jobs:
16+
scan:
17+
runs-on: ubuntu-latest
18+
continue-on-error: true # Ignore errors, we create an issue instead
19+
steps:
20+
- uses: actions/checkout@v6
21+
22+
- name: Scan - Full
23+
uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # 0.35.0
24+
with:
25+
image-ref: ${{ env.TRIVYY_IMAGE_REF }}
26+
27+
- name: Write not configurable options to trivy.yml
28+
run: |
29+
cat > trivy.yml <<EOL
30+
# Only display CVE details otherwise they will get cut off in the issue
31+
table-mode:
32+
- detailed
33+
EOL
34+
35+
- name: Scan - Relevant
36+
id: scan_relevant
37+
uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # 0.35.0
38+
with:
39+
trivy-config: trivy.yml
40+
image-ref: ${{ env.TRIVYY_IMAGE_REF }}
41+
exit-code: 1
42+
severity: 'HIGH,CRITICAL'
43+
output: reported.txt
44+
env:
45+
TRIVY_DISABLE_VEX_NOTICE: '1'
46+
47+
- name: Find already existing issue
48+
id: find-issue
49+
if: ${{ !cancelled() }}
50+
run: |
51+
echo "number=$(gh issue list -l 'bug' -l 'automated' -L 1 -S 'in:title "Trivy Vulnerability Report"' -s 'open' --json 'number' --jq '.[].number')" >> $GITHUB_OUTPUT
52+
env:
53+
GH_TOKEN: ${{ github.token }}
54+
55+
- name: Close issue if everything is fine
56+
if: ${{ success() && steps.find-issue.outputs.number != '' }}
57+
run: gh issue close -r 'not planned' ${{ steps.find-issue.outputs.number }}
58+
env:
59+
GH_TOKEN: ${{ github.token }}
60+
61+
- name: Reformat report
62+
if: ${{ failure() && steps.scan_relevant.conclusion == 'failure' }}
63+
run: |
64+
echo 'Trivy reported vulnerabilities that should be addressed:' > reported.md
65+
echo '```' >> reported.md
66+
cat reported.txt >> reported.md
67+
echo '```' >> reported.md
68+
cat reported.md
69+
70+
- name: Create Issue From File
71+
if: ${{ failure() && steps.scan_relevant.conclusion == 'failure' }}
72+
uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710 # v6
73+
with:
74+
issue-number: ${{ steps.find-issue.outputs.number }}
75+
title: Trivy Vulnerability Report
76+
content-filepath: ./reported.md
77+
labels: bug, automated

0 commit comments

Comments
 (0)