Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/CI-devmode.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: CI-devmode
on:
push:
branches: [main, rhoai-2.10]
paths-ignore:
- 'site/**'
pull_request:
branches: [main, rhoai-2.10]

jobs:
CI:
runs-on: ubuntu-latest

steps:
- name: checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set latest tag and branch name
run: |
echo "GIT_BRANCH=gha-ci" >> $GITHUB_ENV
echo "TAG=$GITHUB_RUN_ID" >> $GITHUB_ENV

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: './go.mod'

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Run pre-commit checks
run: |
pip install pre-commit
pre-commit run --show-diff-on-failure --color=always --all-files

- name: Build
run: make build

- name: Run Unit Tests
run: make test

- name: Create and configure cluster
run: ./hack/create-test-cluster.sh

- name: Deploy Kueue
run: ./hack/deploy-kueue.sh

- name: Install CRDs
run: |
make install -e GIT_BRANCH=${{ env.GIT_BRANCH }} TAG=${{ env.GIT_BRANCH }}-${{ env.TAG }}

- name: Run E2E tests using dev mode controller
run: ./hack/run-dev-mode-tests.sh
46 changes: 46 additions & 0 deletions hack/run-dev-mode-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

# Licensed 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.

# Run backgrounded dev mode controller with e2e tests in foreground

export ROOT_DIR="$(dirname "$(dirname "$(readlink -fn "$0")")")"
export GORACE=1
export CLEANUP_CLUSTER=${CLEANUP_CLUSTER:-"false"}
export CLUSTER_STARTED="true"

source ${ROOT_DIR}/hack/e2e-util.sh

trap cleanup EXIT

# run background_services_gpid test_command
run () {
PID=$1
shift
CODE=0
"$@" || CODE=$?
kill -- -$PID || true
sleep 1
return $CODE
}

NAMESPACE=dev go run ./cmd/main.go &
run $! go run github.com/onsi/ginkgo/v2/ginkgo -v -fail-fast --procs 1 -timeout 130m --label-filter=Kueue ./test/e2e

RC=$?
if [ ${RC} -eq 0 ]
then
DUMP_LOGS="false"
fi
echo "End to end test script return code set to ${RC}"
exit ${RC}