-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
77 changed files
with
5,278 additions
and
11,083 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
# Cli Smoke Test | ||
|
||
name: Moonshot CLI Smoke Test | ||
|
||
on: | ||
# Runs on Pull Request Review | ||
pull_request_review: | ||
types: [submitted] | ||
branches: | ||
- 'dev_main' | ||
|
||
# Run this workflow manually from Actions tab | ||
workflow_dispatch: | ||
inputs: | ||
moonshot_branch: | ||
description: 'Moonshot Branch / Tag Name' | ||
required: true | ||
default: 'dev_main' | ||
type: string | ||
moonshot_data_branch: | ||
description: 'Moonshot Data Branch / Tag Name' | ||
required: true | ||
default: 'dev_main' | ||
type: string | ||
moonshot_ui_branch: | ||
description: 'Moonshot UI Branch / Tag Name' | ||
required: true | ||
default: 'dev_main' | ||
type: string | ||
|
||
# Allow one concurrent deployment | ||
concurrency: | ||
group: ${{ github.repository }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
smoke-test: | ||
|
||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
|
||
steps: | ||
|
||
- name: Checkout Moonshot (Pull Request Review) | ||
if: github.event_name == 'pull_request_review' | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: aiverify-foundation/moonshot | ||
ref: ${{ vars.MOONSHOT_BRANCH }} | ||
|
||
- name: Checkout Moonshot (Workflow Dispatch) | ||
if: github.event_name == 'workflow_dispatch' | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: aiverify-foundation/moonshot | ||
ref: ${{ inputs.moonshot_branch }} | ||
|
||
- name: Setup Python 3.11 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Setup Moonshot | ||
run: | | ||
python -m venv venv | ||
source venv/bin/activate | ||
pip install -r requirements.txt | ||
touch .env | ||
echo "${{ secrets.ENVIRONMENT_VARS }}" >> .env | ||
pwd | ||
- name: Checkout Moonshot Data (Pull Request Review) | ||
if: github.event_name == 'pull_request_review' | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
path: moonshot-data | ||
|
||
- name: Checkout Moonshot Data (Workflow Dispatch) | ||
if: github.event_name == 'workflow_dispatch' | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: aiverify-foundation/moonshot-data | ||
ref: ${{ inputs.moonshot_data_branch }} | ||
path: moonshot-data | ||
|
||
- name: Setup Moonshot Data | ||
run: | | ||
source venv/bin/activate | ||
cd moonshot-data | ||
pip install -r requirements.txt | ||
pwd | ||
- name: Checkout Moonshot UI (Pull Request Review) | ||
if: github.event_name == 'pull_request_review' | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: aiverify-foundation/moonshot-ui | ||
ref: ${{ vars.MOONSHOT_UI_BRANCH }} | ||
path: moonshot-ui | ||
|
||
- name: Checkout Moonshot UI (Workflow Dispatch) | ||
if: github.event_name == 'workflow_dispatch' | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: aiverify-foundation/moonshot-ui | ||
ref: ${{ inputs.moonshot_ui_branch }} | ||
path: moonshot-ui | ||
|
||
- name: Setup Moonshot UI | ||
run: | | ||
cd moonshot-ui | ||
npm ci | ||
npm run build | ||
cd ../ | ||
pwd | ||
- name: Checkout Smoke Test | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: aiverify-foundation/moonshot-smoke-testing | ||
path: moonshot-smoke-testing | ||
|
||
- name: Run Smoke Test | ||
env: | ||
AZURE_OPENAI_URI: ${{ secrets.AZURE_OPENAI_URI }} | ||
AZURE_OPENAI_TOKEN: ${{ secrets.AZURE_OPENAI_TOKEN }} | ||
ADDITIONAL_PARAMETERS: ${{ secrets.ADDITIONAL_PARAMETERS }} | ||
MOONSHOT_URL: ${{ secrets.MOONSHOT_URL }} | ||
MOONSHOT_PORT_NUMBER: ${{ secrets.MOONSHOT_PORT_NUMBER }} | ||
CLI_DIR: ${{ secrets.CLI_DIR }} | ||
run: | | ||
source venv/bin/activate | ||
cd moonshot-smoke-testing | ||
cd tests | ||
pip install python-dotenv | ||
pip install pytest | ||
pwd | ||
pytest test_cli.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.