Skip to content

Commit

Permalink
Fix CI (#703)
Browse files Browse the repository at this point in the history
Use push event to trigger the 0-latest chart release.
Trigger chart release only have helm-charts changes.
Remove the CI-*values.yaml links to fix warning.
Skip values files not able to test. variant_ is used to generate manifests only.
Skip milvus related test depends on PVC setup.

Signed-off-by: Dolpher Du <dolpher.du@intel.com>
  • Loading branch information
yongfengdu authored Jan 16, 2025
1 parent 0943764 commit 4d0bdd2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/pr-chart-e2e.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2024 Intel Corporation
# Copyright (C) 2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

name: E2E test with helm charts
Expand Down Expand Up @@ -50,8 +50,14 @@ jobs:
cut -d'/' -f3 | sort -u )
run_matrix="{\"include\":["
for chart in ${e2e_charts}; do
for file in "$CHARTS_DIR/$chart"/ci-*values.yaml; do
for file in "$CHARTS_DIR/$chart"/*values.yaml; do
if [ -f "$file" ]; then
if [[ "$file" == *"nv-values.yaml" ]] || [[ "$file" == *"hpa-values.yaml" ]] || [[ "$file" == *"/values.yaml" ]]; then
continue
fi
if [[ "$file" == *"variant_"* ]] || [[ "$file" == *"milvus"* ]]; then
continue
fi
filename=$(basename "$file" .yaml)
if [[ "$filename" == *"gaudi"* ]]; then
run_matrix="${run_matrix}{\"example\":\"${chart}\",\"hardware\":\"gaudi\", \"valuefile\":\"${filename}\"},"
Expand All @@ -62,8 +68,14 @@ jobs:
done
done
for chart in ${common_charts}; do
for file in "$CHARTS_DIR/common/$chart"/ci-*values.yaml; do
for file in "$CHARTS_DIR/common/$chart"/*values.yaml; do
if [ -f "$file" ]; then
if [[ "$file" == *"nv-values.yaml" ]] || [[ "$file" == *"hpa-values.yaml" ]] || [[ "$file" == *"/values.yaml" ]]; then
continue
fi
if [[ "$file" == *"variant_"* ]] || [[ "$file" == *"milvus"* ]]; then
continue
fi
filename=$(basename "$file" .yaml)
if [[ "$filename" == *"gaudi"* ]]; then
run_matrix="${run_matrix}{\"example\":\"${chart}\",\"hardware\":\"gaudi\", \"valuefile\":\"${filename}\",\"directory\":\"common\"},"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name: Update the helm charts 0-latest

on:
pull_request_target:
push:
branches:
- main
types: [closed]
Expand All @@ -14,8 +14,7 @@ env:
CHARTS_DIR: "helm-charts"

jobs:
run-on-merge:
if: github.event.pull_request.merged == true
release-on-push:
runs-on: ubuntu-latest

steps:
Expand All @@ -32,7 +31,7 @@ jobs:
echo "Version check failed, only update 0-latest"
exit 1
fi
base_commit=${{ github.event.pull_request.base.sha }}
base_commit=$(git rev-parse HEAD~1) # push event
merged_commit=$(git log -1 --format='%H')
# Update components
common_charts=$(git diff --name-only ${base_commit} ${merged_commit} | \
Expand All @@ -51,8 +50,8 @@ jobs:
popd
# Update Examples
e2e_charts=$(git diff --name-only ${base_commit} ${merged_commit} | \
grep -v "common" | \
grep -vE 'README.md|*.sh' | \
grep "^$CHARTS_DIR" | \
grep -vE 'README.md|common|*.sh' | \
cut -d'/' -f2 | sort -u )
echo "Charts to be updated: $e2e_charts"
echo "${{ secrets.ACTION_TOKEN }}" | helm registry login ghcr.io -u opea --password-stdin
Expand Down

0 comments on commit 4d0bdd2

Please sign in to comment.