Skip to content

Commit fc0556f

Browse files
Add renovate configuration & PR test checks (#13)
* add registry test cases Signed-off-by: Michael Valdron <[email protected]> * add ci workflow Signed-off-by: Michael Valdron <[email protected]> * init renovate config Signed-off-by: Michael Valdron <[email protected]> * remove odov3 check due to incompatibility with samples Signed-off-by: Michael Valdron <[email protected]> * takeout odo variable Signed-off-by: Michael Valdron <[email protected]> --------- Signed-off-by: Michael Valdron <[email protected]>
1 parent 1509690 commit fc0556f

File tree

3 files changed

+163
-0
lines changed

3 files changed

+163
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# This workflow will build a .NET project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3+
4+
name: .NET
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
ci:
18+
runs-on: ubuntu-latest
19+
strategy:
20+
matrix:
21+
dotnet:
22+
- '6.0.x'
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26+
- name: Setup .NET
27+
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
28+
with:
29+
dotnet-version: ${{ matrix.dotnet }}
30+
- name: Restore dependencies
31+
run: dotnet restore
32+
- name: Build
33+
run: dotnet build --no-restore
34+
- name: Test
35+
run: dotnet test --no-build --verbosity normal
36+
docker:
37+
runs-on: ubuntu-latest
38+
needs: ci
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
42+
43+
- name: Build the Docker image
44+
run: docker build . --file docker/Dockerfile --tag dotnet-image:$(date +%s)
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+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": ["local>devfile-samples/.github:renovate-config"],
4+
"enabledManagers": ["nuget", "dockerfile"],
5+
"packageRules": [
6+
{
7+
"matchManagers": ["nuget"],
8+
"groupName": "nuget dependencies",
9+
"groupSlug": "nuget-deps",
10+
"commitMessageTopic": "NuGet {{depName}}"
11+
},
12+
{
13+
"matchManagers": ["dockerfile"],
14+
"groupName": "dockerfile dependencies",
15+
"groupSlug": "nuget-deps",
16+
"commitMessageTopic": "Dockerfile {{depName}}"
17+
18+
},
19+
{
20+
"matchManagers": ["nuget"],
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)