forked from microsoft/genaiops-promptflow-template
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (50 loc) · 1.61 KB
/
build_validation_workflow.yml
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
name: build_validation
on:
workflow_call:
inputs:
use_case_base_path:
type: string
description: "The flow use-case to validate"
required: true
secrets:
azure_credentials:
description: "service principal auth to Azure"
required: true
jobs:
validate-code:
name: job for validating code and structure
runs-on: ubuntu-latest
steps:
- name: Checkout Actions
uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Load all build validation related dependencies
shell: bash
run: |
set -e # fail on error
python -m pip install --upgrade pip
python -m pip install -r .github/requirements/build_validation_requirements.txt
az version
- name: Azure login
uses: azure/login@v1
with:
creds: ${{ secrets.azure_credentials }}
- name: load the current Azure subscription details
id: subscription_details
shell: bash
run: |
export subscriptionId=$(az account show --query id -o tsv)
echo "SUBSCRIPTION_ID=$subscriptionId" >> $GITHUB_OUTPUT
- name: Python code linting
run: flake8 ./llmops ./tests
- name: Execute Unit Tests
shell: bash
run: |
pytest ${{ inputs.use_case_base_path }}/tests --junitxml=junit/test-results.xml --cov=. --cov-report=xml
- name: Publish Unit Test Results
uses: actions/upload-artifact@v3
with:
name: unit-test-results
path: "**/test-*.xml"