Skip to content

Commit f45f508

Browse files
authored
allow gmc e2e workflow to get secrets (opea-project#444)
Signed-off-by: Yingchun Guo <yingchun.guo@intel.com>
1 parent 284d855 commit f45f508

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

.github/workflows/gmc-e2e.yaml

+9-15
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
name: E2E test with GMC
55

66
on:
7-
pull_request:
7+
pull_request_target:
88
branches: [main]
99
types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped
1010
paths:
@@ -56,11 +56,14 @@ jobs:
5656
echo "KUBECTL_TIMEOUT_SECONDS=60s" >> $GITHUB_ENV
5757
echo "continue_test=true" >> $GITHUB_ENV
5858
echo "should_cleanup=false" >> $GITHUB_ENV
59-
echo "skip_validate=true" >> $GITHUB_ENV
6059
echo "APP_NAMESPACE=$APP_NAMESPACE"
6160
62-
- name: Kubectl install
63-
id: install
61+
- name: Run tests
62+
id: run-test
63+
env:
64+
HUGGINGFACEHUB_API_TOKEN: ${{ secrets.HUGGINGFACEHUB_API_TOKEN }}
65+
GOOGLE_CSE_ID: ${{ secrets.GOOGLE_CSE_ID }}
66+
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
6467
run: |
6568
if [[ ! -f ${{ github.workspace }}/${{ matrix.example }}/tests/test_gmc_on_${{ matrix.hardware }}.sh ]]; then
6669
echo "No test script found, exist test!"
@@ -70,24 +73,15 @@ jobs:
7073
${{ github.workspace }}/${{ matrix.example }}/tests/test_gmc_on_${{ matrix.hardware }}.sh install_${{ matrix.example }}
7174
echo "Testing ${{ matrix.example }}, waiting for pod ready..."
7275
if kubectl rollout status deployment --namespace "$APP_NAMESPACE" --timeout "$ROLLOUT_TIMEOUT_SECONDS"; then
73-
echo "Testing gmc ${{ matrix.example }}, waiting for pod ready done!"
74-
echo "skip_validate=false" >> $GITHUB_ENV
76+
echo "Testing gmc ${{ matrix.example }}, running validation test..."
77+
${{ github.workspace }}/${{ matrix.example }}/tests/test_gmc_on_${{ matrix.hardware }}.sh validate_${{ matrix.example }}
7578
else
7679
echo "Timeout waiting for pods in namespace $APP_NAMESPACE to be ready!"
7780
exit 1
7881
fi
7982
sleep 60
8083
fi
8184
82-
- name: Validate e2e test
83-
if: always()
84-
run: |
85-
if $skip_validate; then
86-
echo "Skip validate"
87-
else
88-
${{ github.workspace }}/${{ matrix.example }}/tests/test_gmc_on_${{ matrix.hardware }}.sh validate_${{ matrix.example }}
89-
fi
90-
9185
- name: Kubectl uninstall
9286
if: always()
9387
run: |

0 commit comments

Comments
 (0)