Skip to content

Commit 3629a8a

Browse files
authored
Merge branch 'main' into devfile#1718-renovate
2 parents a8982d2 + 0681132 commit 3629a8a

File tree

3 files changed

+83
-0
lines changed

3 files changed

+83
-0
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Validate with Devfile Registry Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
validate-devfile:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout current repo
16+
uses: actions/checkout@v4
17+
with:
18+
path: current-repo
19+
20+
- name: Checkout devfile registry
21+
uses: actions/checkout@v4
22+
with:
23+
repository: devfile/registry
24+
path: registry
25+
26+
- name: Setup test environment with overrides
27+
run: |
28+
cp -r registry/tests registry-tests-base
29+
30+
if [ -d "current-repo/tests" ]; then
31+
echo "Found local test overrides, applying them..."
32+
cp -r current-repo/tests/* registry-tests-base/ 2>/dev/null || true
33+
fi
34+
35+
mkdir -p registry/stacks/current-sample
36+
cp current-repo/devfile.yaml registry/stacks/current-sample/
37+
cp -r registry-tests-base/* registry/tests/
38+
39+
- name: Setup Go
40+
uses: actions/setup-go@v4
41+
with:
42+
go-version: '1.21'
43+
44+
- name: Install dependencies
45+
run: |
46+
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
47+
sudo chmod +x /usr/local/bin/yq
48+
go install github.com/onsi/ginkgo/v2/ginkgo@latest
49+
50+
- name: Setup Minikube
51+
uses: medyagh/setup-minikube@master
52+
with:
53+
minikube-version: latest
54+
kubernetes-version: v1.28.0
55+
56+
- name: Run Registry Validation Tests
57+
working-directory: registry
58+
run: |
59+
cd tests/check_non_terminating
60+
go build -o flatten-parent .
61+
cd ../..
62+
63+
export STACKS="current-sample"
64+
export TEST_NAMESPACE="default"
65+
export YQ_PATH="yq"
66+
export ENV="minikube"
67+
68+
echo "Running validation tests for current sample..."
69+
70+
echo "=== Schema Validation ==="
71+
cd tests
72+
bash validate_devfile_schemas.sh
73+
74+
echo "=== Non-terminating Test ==="
75+
bash check_non_terminating.sh
76+
77+
echo "All tests completed successfully!"
78+
79+
- name: Cleanup
80+
if: always()
81+
run: |
82+
kubectl delete pods --all -n default --ignore-not-found=true || true

.github/workflows/validate_devfile.yaml

Whitespace-only changes.

tests/validate_devfile_schemas.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ set -x
66
SAMPLE_PATH="$(pwd)"
77
DEVFILE_PATH=${DEVFILE_PATH:-"$SAMPLE_PATH/devfile.yaml"}
88

9+
910
# Path to the devfile/registry repository (assumed to be cloned as a sibling)
1011
REGISTRY_PATH=${REGISTRY_PATH:-"../registry"}
1112

0 commit comments

Comments
 (0)