-
Notifications
You must be signed in to change notification settings - Fork 37
154 lines (134 loc) · 4.27 KB
/
smoke-test-cli.yaml
File metadata and controls
154 lines (134 loc) · 4.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# 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: 60
steps:
# [WS-299] Remove pre-installed tools to free up space for installation Moonshot-data
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@v1.3.1
with:
# Required for Python
tool-cache: false
# Remove tools
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- 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