Skip to content

Commit

Permalink
Merge branch 'dev_main' into ms-543
Browse files Browse the repository at this point in the history
  • Loading branch information
imda-kelvinkok committed Oct 10, 2024
2 parents 83cc6d0 + d8a250f commit 1d495ec
Show file tree
Hide file tree
Showing 77 changed files with 5,278 additions and 11,083 deletions.
31 changes: 14 additions & 17 deletions .github/workflows/sca-scan.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Software Composition Analysis

on:
# Runs when a pull request review is being submitted
# Runs when a pull request review is being submitted
on:
pull_request:

# Run this workflow manually from Actions tab
Expand All @@ -22,21 +22,21 @@ jobs:
software-composition-analysis:

runs-on: ubuntu-latest
timeout-minutes: 20
timeout-minutes: 15

steps:

- name: Checkout Code (Pull_Request)
if: github.event_name == 'pull_request'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
submodules: recursive

- name: Checkout Code (Workflow_Dispatch)
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch_to_test }}

Expand All @@ -60,21 +60,18 @@ jobs:
run: |
python -m venv venv
source venv/bin/activate
# pip install -r requirements.txt
pip install poetry
poetry install
bash <(curl -s -L https://detect.synopsys.com/detect9.sh) --blackduck.url=https://blackduck.aipo-imda.net/ --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.detector.search.depth=10 --detect.project.name=aiverify-moonshot-data --detect.project.version.name=$BRANCH --detect.source.path=. --detect.code.location.name="aiverify-moonshot-data_$BRANCH" --detect.excluded.directories=/tests,/venv --blackduck.trust.cert=true --detect.blackduck.scan.mode=RAPID
pip install -r requirements.txt
bash <(curl -s -L https://detect.synopsys.com/detect9.sh) --blackduck.url=https://blackduck.aipo-imda.net/ --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.detector.search.depth=10 --detect.project.name=aiverify-moonshot-data --detect.project.version.name=$BRANCH --detect.source.path=. --detect.code.location.name="aiverify-moonshot-data_$BRANCH" --detect.excluded.directories=/tests --blackduck.trust.cert=true --detect.excluded.detector.types=POETRY --detect.blackduck.scan.mode=RAPID
cd ../
- name: Install & Scan MOONSHOT DATA (Workflow_Dispatch)
if: github.event_name == 'workflow_dispatch'
run: |
python -m venv venv
source venv/bin/activate
# pip install -r requirements.txt
pip install poetry
poetry install
bash <(curl -s -L https://detect.synopsys.com/detect9.sh) --blackduck.url=https://blackduck.aipo-imda.net/ --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.detector.search.depth=10 --detect.project.name=aiverify-moonshot-data --detect.project.version.name=$BRANCH --detect.source.path=. --detect.code.location.name="aiverify-moonshot-data_$BRANCH" --detect.excluded.directories=/tests,/venv --blackduck.trust.cert=true --detect.notices.report=true --detect.notices.report.path=.
pip install -r requirements.txt
bash <(curl -s -L https://detect.synopsys.com/detect9.sh) --blackduck.url=https://blackduck.aipo-imda.net/ --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.detector.search.depth=10 --detect.project.name=aiverify-moonshot-data --detect.project.version.name=$BRANCH --detect.source.path=. --detect.code.location.name="aiverify-moonshot-data_$BRANCH" --detect.excluded.directories=/tests --blackduck.trust.cert=true --detect.excluded.detector.types=POETRY --detect.notices.report=true --detect.notices.report.path=.
mv aiverify_moonshot_data_main_Black_Duck_Notices_Report.txt NOTICES.md
- name: Configure GIT (Workflow_Dispatch)
if: github.event_name == 'workflow_dispatch'
Expand All @@ -92,8 +89,8 @@ jobs:
- name: Commit Notice File (Workflow_Dispatch)
if: github.event_name == 'workflow_dispatch'
run: |
git add .
git commit -m "Update Notices"
git add NOTICES.md
git commit -m "Update NOTICES.md"
git push -f -u origin HEAD
shell: bash

Expand All @@ -102,7 +99,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr create --title "Update License for Moonshot" --body "This PR updates adds License File for Moonshot" --base main --head notices
gh pr create --title "Update NOTICES.md for Moonshot Data" --body "This PR updates Notice File for Moonshot Data" --base main --head notices
shell: bash

- name: Merge PR (Workflow_Dispatch)
Expand Down
140 changes: 140 additions & 0 deletions .github/workflows/smoke-test-cli.yaml
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
4 changes: 2 additions & 2 deletions .github/workflows/smoke-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
types: [submitted]
branches:
- 'dev_main'

# Run this workflow manually from Actions tab
workflow_dispatch:
inputs:
Expand Down Expand Up @@ -37,7 +37,7 @@ jobs:
smoke-test:

runs-on: ubuntu-latest
timeout-minutes: 20
timeout-minutes: 60

steps:

Expand Down
Loading

0 comments on commit 1d495ec

Please sign in to comment.