Testing-DoNotMerge-Initegrating GenAI with ASIM PR #2586
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
# Each pull request that updates ASIM parsers triggers the script. | |
# The script runs ASIM Schema and Data testers on the "eco-connector-test" workspace. | |
name: Run ASIM tests on "ASIM-SchemaDataTester-GithubShared" workspace | |
on: | |
pull_request: | |
types: [opened, edited, reopened, synchronize] | |
branches: | |
- master | |
paths: | |
- 'Parsers/ASimDns/Parsers/**' | |
- 'Parsers/ASimNetworkSession/Parsers/**' | |
- 'Parsers/ASimWebSession/Parsers/**' | |
- 'Parsers/ASimProcessEvent/Parsers/**' | |
- 'Parsers/ASimAuditEvent/Parsers/**' | |
- 'Parsers/ASimAuthentication/Parsers/**' | |
- 'Parsers/ASimFileEvent/Parsers/**' | |
- 'Parsers/ASimRegistryEvent/Parsers/**' | |
- 'Parsers/ASimUserManagement/Parsers/**' | |
- 'Parsers/ASimDhcpEvent/Parsers/**' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
Run-ASim-Generative-AI-Task: | |
name: Run ASim Parser Generative AI tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout pull request branch | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{github.event.pull_request.head.ref}} | |
repository: ${{github.event.pull_request.head.repo.full_name}} | |
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. | |
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. | |
- name: Setup git config | |
run: | | |
git config --local user.name "github-actions[bot]" | |
git config --local user.email "<>" | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install required Python packages | |
run: | | |
pip install azure-identity openai pydantic | |
- name: Login to Azure Public Cloud | |
uses: azure/login@v2 | |
with: | |
client-id: ${{ secrets.AZURE_ASIM_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
allow-no-subscriptions: true | |
- name: Summarize PR with Python script | |
run: | | |
filePath=".script/tests/asimParsersTest/ASIM-AI-Summarize_pr.py" | |
python "$filePath" | |
env: | |
AZURE_OPENAI_ENDPOINT: "https://asimparserusinggenai2.openai.azure.com/" | |
AZURE_AI_SEARCH_ENDPOINT: "https://asim-parser-using-gen-ai.search.windows.net" | |
AZURE_AI_SEARCH_INDEX: "asimindexinternet" | |
GITHUB_PR_NUMBER: "${{ github.event.pull_request.number }}" | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |