forked from citrusframework/yaks
-
Notifications
You must be signed in to change notification settings - Fork 1
163 lines (157 loc) · 5.39 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# ---------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ---------------------------------------------------------------------------
name: build
on:
pull_request:
branches:
- main
paths-ignore:
- '**.adoc'
- 'KEYS'
- 'LICENSE'
- 'NOTICE'
push:
branches:
- main
paths-ignore:
- '**.adoc'
- 'KEYS'
- 'LICENSE'
- 'NOTICE'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
- name: Checkout code
uses: actions/checkout@v3
- name: Cache Go modules
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Cache Maven modules
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-m2-
- name: Test
run: |
make check-licenses test package-artifacts
test:
runs-on: ubuntu-latest
env:
YAKS_IMAGE_NAME: "kind-registry:5000/yaks"
YAKS_IMAGE_VERSION: "latest"
YAKS_RUN_OPTIONS: "--timeout=180s"
steps:
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
- name: Checkout code
uses: actions/checkout@v3
- name: Cache Go modules
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Cache Maven modules
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-m2-
- name: Kind Cluster
uses: container-tools/kind-action@v1
with:
version: v0.14.0
node_image: kindest/node:v1.23.6@sha256:b1fa224cc6c7ff32455e0b1fd9cbfd3d3bc87ecaa8fcb06961ed1afb3db0f9ae
- name: Info
run: |
kubectl version
kubectl cluster-info
kubectl describe nodes
- name: Camel K Tools
uses: container-tools/[email protected]
with:
version: v1.12.1
- name: Build
run: |
make IMAGE_NAME=$YAKS_IMAGE_NAME VERSION=$YAKS_IMAGE_VERSION set-version-file build images-no-test
sudo cp yaks /usr/local/bin/
docker push $YAKS_IMAGE_NAME:$YAKS_IMAGE_VERSION
- name: Install Camel K
run: |
# Configure install options
export KAMEL_INSTALL_BUILD_PUBLISH_STRATEGY=Spectrum
export KAMEL_INSTALL_REGISTRY=$KIND_REGISTRY
export KAMEL_INSTALL_REGISTRY_INSECURE=true
kamel install --global --olm=false
- name: Install YAKS
run: |
yaks install --operator-image $YAKS_IMAGE_NAME:$YAKS_IMAGE_VERSION
- name: E2E Tests
run: |
# Eventually `yaks run examples` should work
# For now:
yaks run examples/yaml $YAKS_RUN_OPTIONS
yaks run examples/xml $YAKS_RUN_OPTIONS
yaks run examples/groovy $YAKS_RUN_OPTIONS
yaks run examples/camel $YAKS_RUN_OPTIONS
yaks run examples/camel-k $YAKS_RUN_OPTIONS
# yaks run examples/extension $YAKS_RUN_OPTIONS --upload steps
yaks run examples/http $YAKS_RUN_OPTIONS
yaks run examples/jdbc $YAKS_RUN_OPTIONS
yaks run examples/jitpack $YAKS_RUN_OPTIONS
yaks run examples/kamelets $YAKS_RUN_OPTIONS
#yaks run examples/knative $YAKS_RUN_OPTIONS
yaks run examples/kubernetes $YAKS_RUN_OPTIONS
yaks run examples/logging $YAKS_RUN_OPTIONS
yaks run examples/namespace $YAKS_RUN_OPTIONS
yaks run examples/openapi $YAKS_RUN_OPTIONS
yaks run examples/openapi-server $YAKS_RUN_OPTIONS
yaks run examples/run-scripts $YAKS_RUN_OPTIONS
yaks run examples/secrets $YAKS_RUN_OPTIONS
yaks run examples/settings $YAKS_RUN_OPTIONS
yaks run examples/test-group $YAKS_RUN_OPTIONS
yaks run examples/helloworld.feature $YAKS_RUN_OPTIONS
yaks run examples/selenium $YAKS_RUN_OPTIONS
yaks run examples/dump $YAKS_RUN_OPTIONS
yaks run examples/postgresql $YAKS_RUN_OPTIONS
yaks run examples/aws-s3 $YAKS_RUN_OPTIONS
yaks run examples/aws-kinesis $YAKS_RUN_OPTIONS