Skip to content

Commit 9f4b53c

Browse files
author
Lucas Yoon
committed
test
1 parent 8336f71 commit 9f4b53c

1 file changed

Lines changed: 110 additions & 42 deletions

File tree

.github/workflows/validate-with-registry.yaml

Lines changed: 110 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,62 +5,130 @@ on:
55
branches: [ main ]
66
pull_request:
77
branches: [ main ]
8-
workflow_dispatch:
98

10-
jobs:
11-
validate-devfile:
12-
runs-on: ubuntu-latest
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
11+
cancel-in-progress: true
1312

14-
env:
15-
REGISTRY_PATH: ${{ github.workspace }}/registry
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+
ODOV3_VERSION: '3.16.1'
1623

24+
jobs:
25+
validate-devfile-schema:
26+
name: validate devfile schemas
27+
runs-on: ubuntu-latest
1728
steps:
1829
- name: Checkout current repo
19-
uses: actions/checkout@v4
30+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2031
with:
2132
path: current-repo
2233

2334
- name: Checkout devfile registry
24-
uses: actions/checkout@v4
35+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2536
with:
2637
repository: devfile/registry
27-
path: registry
28-
29-
- name: Setup test environment with overrides
30-
run: |
31-
mkdir -p registry/stacks/python-basic
32-
cp -r current-repo/* registry/stacks/python-basic/
33-
38+
path: ${{ env.REGISTRY_PATH }}
39+
3440
- name: Setup Go
35-
uses: actions/setup-go@v4
41+
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
3642
with:
37-
go-version: '1.21'
43+
go-version: ${{ env.GO_VERSION }}
44+
45+
- name: Install yq
46+
run: |
47+
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
3848
3949
- name: Install Ginkgo
40-
run: |
41-
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
42-
sudo chmod +x /usr/local/bin/yq
43-
go install github.com/onsi/ginkgo/v2/ginkgo@latest
50+
run: go install github.com/onsi/ginkgo/v2/ginkgo@${{ env.GINKGO_VERSION }}
51+
52+
- name: Validate sample
53+
run: (cd ${{ env.REGISTRY_PATH }} && bash tests/validate_devfile_schemas.sh --stacksPath ${{ github.workspace }} --stackDirs current-repo)
4454

45-
- name: Setup Minikube
46-
uses: medyagh/setup-minikube@master
47-
with:
48-
minikube-version: latest
49-
kubernetes-version: v1.28.0
50-
51-
- name: Run Registry Validation Tests
52-
env:
53-
REGISTRY_PATH: ${{ github.workspace }}/registry
54-
TEST_NAMESPACE: "default"
55-
YQ_PATH: "yq"
56-
ENV: "minikube"
57-
run: |
58-
cd registry
59-
60-
echo "=== Schema Validation ==="
61-
bash tests/validate_devfile_schemas.sh --stacksPath stacks --stackDirs python-basic
55+
non-terminating:
56+
name: check for non-terminating images
57+
runs-on: ubuntu-latest
58+
steps:
59+
- name: Checkout
60+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
61+
with:
62+
path: current-repo
63+
fetch-depth: 0
64+
65+
- name: Checkout devfile registry
66+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
67+
with:
68+
repository: devfile/registry
69+
path: ${{ env.REGISTRY_PATH }}
70+
71+
- name: Setup Go
72+
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
73+
with:
74+
go-version: ${{ env.GO_VERSION }}
6275

63-
- name: Cleanup
64-
if: always()
65-
run: |
66-
kubectl delete pods --all -n default --ignore-not-found=true || true
76+
- name: Setup Minikube
77+
uses: manusa/actions-setup-minikube@0e8062ceff873bd77979f39cf8fd3621416afe4d # v2.13.0
78+
with:
79+
minikube version: ${{ env.MINIKUBE_VERSION }}
80+
kubernetes version: ${{ env.KUBERNETES_VERSION }}
81+
driver: "docker"
82+
github token: ${{ secrets.GITHUB_TOKEN }}
83+
start args: "--addons=ingress ${{ env.MINIKUBE_RESOURCES }}"
84+
85+
- name: Check that containers components are non terminating
86+
run: |
87+
go build -C ${{ env.REGISTRY_PATH }}/tests/check_non_terminating -o flatten-parent
88+
bash ${{ env.REGISTRY_PATH }}/tests/check_non_terminating.sh --stacksPath $(pwd) --stackDirs current-repo
89+
90+
odov3:
91+
name: with odo v3
92+
runs-on: ubuntu-latest
93+
needs: [non-terminating, validate-devfile-schema]
94+
if: success() || failure()
95+
steps:
96+
- name: Checkout
97+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
98+
with:
99+
path: current-repo
100+
fetch-depth: 0
101+
102+
- name: Checkout devfile registry
103+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
104+
with:
105+
repository: devfile/registry
106+
path: ${{ env.REGISTRY_PATH }}
107+
108+
- name: Setup Minikube
109+
uses: manusa/actions-setup-minikube@0e8062ceff873bd77979f39cf8fd3621416afe4d # v2.13.0
110+
with:
111+
minikube version: ${{ env.MINIKUBE_VERSION }}
112+
kubernetes version: ${{ env.KUBERNETES_VERSION }}
113+
driver: "docker"
114+
github token: ${{ secrets.GITHUB_TOKEN }}
115+
start args: "--addons=ingress ${{ env.MINIKUBE_RESOURCES }}"
116+
117+
- name: Install Go
118+
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
119+
with:
120+
go-version: ${{ env.GO_VERSION }}
121+
122+
- name: Install odo latest version v3
123+
uses: redhat-actions/openshift-tools-installer@2de9a80cf012ad0601021515481d433b91ef8fd5 # v1
124+
with:
125+
odo: ${{ env.ODOV3_VERSION }}
126+
127+
- name: Install Ginkgo
128+
run: go install github.com/onsi/ginkgo/v2/ginkgo@${{ env.GINKGO_VERSION }}
129+
130+
- name: Check odo version
131+
run: odo version
132+
133+
- name: Check the devfile sample with odo v3
134+
run: (cd ${{ env.REGISTRY_PATH }} && bash tests/check_odov3.sh --stacksPath ${{ github.workspace }} --stackDirs current-repo)

0 commit comments

Comments
 (0)