Skip to content

Commit 69f9fdc

Browse files
authored
Add CI configuration for dev-mode controller (#233)
Fixes #67.
1 parent 8ea11e3 commit 69f9fdc

File tree

2 files changed

+103
-0
lines changed

2 files changed

+103
-0
lines changed

.github/workflows/CI-devmode.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: CI-devmode
2+
on:
3+
push:
4+
branches: [main, rhoai-2.10]
5+
paths-ignore:
6+
- 'site/**'
7+
pull_request:
8+
branches: [main, rhoai-2.10]
9+
10+
jobs:
11+
CI:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: checkout code
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Set latest tag and branch name
21+
run: |
22+
echo "GIT_BRANCH=gha-ci" >> $GITHUB_ENV
23+
echo "TAG=$GITHUB_RUN_ID" >> $GITHUB_ENV
24+
25+
- name: Set up Go
26+
uses: actions/setup-go@v5
27+
with:
28+
go-version-file: './go.mod'
29+
30+
- name: Set up Python
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: '3.11'
34+
35+
- name: Run pre-commit checks
36+
run: |
37+
pip install pre-commit
38+
pre-commit run --show-diff-on-failure --color=always --all-files
39+
40+
- name: Build
41+
run: make build
42+
43+
- name: Run Unit Tests
44+
run: make test
45+
46+
- name: Create and configure cluster
47+
run: ./hack/create-test-cluster.sh
48+
49+
- name: Deploy Kueue
50+
run: ./hack/deploy-kueue.sh
51+
52+
- name: Install CRDs
53+
run: |
54+
make install -e GIT_BRANCH=${{ env.GIT_BRANCH }} TAG=${{ env.GIT_BRANCH }}-${{ env.TAG }}
55+
56+
- name: Run E2E tests using dev mode controller
57+
run: ./hack/run-dev-mode-tests.sh

hack/run-dev-mode-tests.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Run backgrounded dev mode controller with e2e tests in foreground
16+
17+
export ROOT_DIR="$(dirname "$(dirname "$(readlink -fn "$0")")")"
18+
export GORACE=1
19+
export CLEANUP_CLUSTER=${CLEANUP_CLUSTER:-"false"}
20+
export CLUSTER_STARTED="true"
21+
22+
source ${ROOT_DIR}/hack/e2e-util.sh
23+
24+
trap cleanup EXIT
25+
26+
# run background_services_gpid test_command
27+
run () {
28+
PID=$1
29+
shift
30+
CODE=0
31+
"$@" || CODE=$?
32+
kill -- -$PID || true
33+
sleep 1
34+
return $CODE
35+
}
36+
37+
NAMESPACE=dev go run ./cmd/main.go &
38+
run $! go run github.com/onsi/ginkgo/v2/ginkgo -v -fail-fast --procs 1 -timeout 130m --label-filter=Kueue ./test/e2e
39+
40+
RC=$?
41+
if [ ${RC} -eq 0 ]
42+
then
43+
DUMP_LOGS="false"
44+
fi
45+
echo "End to end test script return code set to ${RC}"
46+
exit ${RC}

0 commit comments

Comments
 (0)