Skip to content

Commit

Permalink
add example test workflow
Browse files Browse the repository at this point in the history
Signed-off-by: chensuyue <[email protected]>
  • Loading branch information
chensuyue committed Aug 11, 2024
1 parent 5470e6f commit e46aa97
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 81 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/pr-examples-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

name: Example-test

on:
pull_request:
branches: [main]
types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped
paths:
- .github/workflows/pr-examples-test.yml
- comps/cores/**
- requirements.txt
- setup.py

# If there is a new commit, the previous jobs will be canceled
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
MegaService:
runs-on: gaudi
steps:
- name: Clean Up Working Directory
run: |
sudo rm -rf ${{github.workspace}} || true
echo y | docker system prune
- name: Checkout out Repo
uses: actions/checkout@v4
with:
ref: "refs/pull/${{ github.event.number }}/merge"

- name: Run ChatQnA
run: |
git clone https://github.com/opea-project/GenAIExamples.git
cd GenAIExamples/ChatQnA/tests
GenAIComps_dir=${{github.workspace}}
sed -i "s#cd GenAIComps#cd ${GenAIComps_dir}#g" test_chatqna_on_gaudi.sh
sed -i "s#docker build -t#docker build --no-cache -q -t#g" test_chatqna_on_gaudi.sh
cat test_chatqna_on_gaudi.sh
bash test_chatqna_on_gaudi.sh
- name: Clean up container
if: cancelled() || failure()
run: |
cd ${{ github.workspace }}/GenAIExamples/ChatQnA/docker/gaudi
docker compose stop && docker compose rm -f
echo y | docker system prune --all
- name: Publish pipeline artifact
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: "Examples-Test-Logs"
path: ${{ github.workspace }}/GenAIExamples/ChatQnA/tests/*.log
4 changes: 3 additions & 1 deletion .github/workflows/pr-microservice-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ jobs:
continue-on-error: true
steps:
- name: Clean Up Working Directory
run: sudo rm -rf ${{github.workspace}}/*
run: |
sudo rm -rf ${{github.workspace}}
echo y | docker system prune
- name: Checkout out Repo
uses: actions/checkout@v4
Expand Down
80 changes: 0 additions & 80 deletions tests/test_workflow_chatqna.py

This file was deleted.

0 comments on commit e46aa97

Please sign in to comment.