Skip to content

Commit 4bf6830

Browse files
authored
Add renovate configuration & PR test checks (#48)
* Add support for renovate * Fix mvnw issue * Merge all steps * Remove odo version
1 parent 558117e commit 4bf6830

File tree

3 files changed

+148
-0
lines changed

3 files changed

+148
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
on:
2+
push:
3+
branches: ["main"]
4+
pull_request:
5+
branches: ["main"]
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
ci:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
18+
- name: Set up JDK 17
19+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
20+
with:
21+
java-version: "17"
22+
distribution: "temurin"
23+
cache: maven
24+
25+
- name: Build with Maven
26+
run: mvn clean package -B
27+
28+
- name: Build Docker image
29+
run: docker build -f docker/Dockerfile -t springboot-app .
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Validate with Devfile Registry Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
11+
cancel-in-progress: true
12+
13+
env:
14+
MINIKUBE_VERSION: "v1.29.0"
15+
MINIKUBE_RESOURCES: "--memory 14gb --cpus 4"
16+
KUBERNETES_VERSION: "v1.25.2"
17+
TEST_DELTA: false
18+
REGISTRY_PATH: ${{ github.workspace }}/registry
19+
GO_VERSION: "1.23"
20+
GINKGO_VERSION: v2.19.0
21+
YQ_VERSION: v4.44.1
22+
23+
jobs:
24+
validate-devfile-schema:
25+
name: validate devfile schemas
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout current repo
29+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
30+
with:
31+
path: current-repo
32+
33+
- name: Checkout devfile registry
34+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
35+
with:
36+
repository: devfile/registry
37+
path: ${{ env.REGISTRY_PATH }}
38+
39+
- name: Setup Go
40+
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
41+
with:
42+
go-version: ${{ env.GO_VERSION }}
43+
44+
- name: Install yq
45+
run: |
46+
curl -sL -O https://github.com/mikefarah/yq/releases/download/${{ env.YQ_VERSION }}/yq_linux_amd64 -o /usr/local/bin/yq && mv ./yq_linux_amd64 /usr/local/bin/yq && chmod +x /usr/local/bin/yq
47+
48+
- name: Install Ginkgo
49+
run: go install github.com/onsi/ginkgo/v2/ginkgo@${{ env.GINKGO_VERSION }}
50+
51+
- name: Validate sample
52+
run: (cd ${{ env.REGISTRY_PATH }} && bash tests/validate_devfile_schemas.sh --stacksPath ${{ github.workspace }} --stackDirs current-repo)
53+
54+
non-terminating:
55+
name: check for non-terminating images
56+
runs-on: ubuntu-latest
57+
steps:
58+
- name: Checkout
59+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
60+
with:
61+
path: current-repo
62+
fetch-depth: 0
63+
64+
- name: Checkout devfile registry
65+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
66+
with:
67+
repository: devfile/registry
68+
path: ${{ env.REGISTRY_PATH }}
69+
70+
- name: Setup Go
71+
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
72+
with:
73+
go-version: ${{ env.GO_VERSION }}
74+
75+
- name: Setup Minikube
76+
uses: manusa/actions-setup-minikube@0e8062ceff873bd77979f39cf8fd3621416afe4d # v2.13.0
77+
with:
78+
minikube version: ${{ env.MINIKUBE_VERSION }}
79+
kubernetes version: ${{ env.KUBERNETES_VERSION }}
80+
driver: "docker"
81+
github token: ${{ secrets.GITHUB_TOKEN }}
82+
start args: "--addons=ingress ${{ env.MINIKUBE_RESOURCES }}"
83+
84+
- name: Check that containers components are non terminating
85+
run: |
86+
go build -C ${{ env.REGISTRY_PATH }}/tests/check_non_terminating -o flatten-parent
87+
(cd ${{ env.REGISTRY_PATH }} && bash ${{ env.REGISTRY_PATH }}/tests/check_non_terminating.sh --stacksPath ${{ github.workspace }} --stackDirs current-repo)

renovate.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
{
3+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
4+
"extends": ["local>devfile-samples/.github:renovate-config"],
5+
"enabledManagers": ["maven", "dockerfile"],
6+
"packageRules": [
7+
{
8+
"matchManagers": ["maven"],
9+
"groupName": "maven dependencies",
10+
"groupSlug": "maven-deps",
11+
"commitMessageTopic": "Maven {{depName}}"
12+
},
13+
{
14+
"matchManagers": ["dockerfile"],
15+
"groupName": "dockerfile dependencies",
16+
"groupSlug": "dockerfile-deps",
17+
"commitMessageTopic": "Dockerfile {{depName}}"
18+
},
19+
{
20+
"matchManagers": ["maven"],
21+
"matchUpdateTypes": ["major"],
22+
"matchBaseBranches": "main",
23+
"enabled": false
24+
},
25+
{
26+
"matchManagers": ["dockerfile"],
27+
"matchUpdateTypes": ["major"],
28+
"matchBaseBranches": "main",
29+
"enabled": false
30+
}
31+
]
32+
}

0 commit comments

Comments
 (0)