Skip to content

Updating pipeline to run E2E tests for ooproc #270

Updating pipeline to run E2E tests for ooproc

Updating pipeline to run E2E tests for ooproc #270

Workflow file for this run

name: Build
on:
push:
branches: [ "main" ]
paths-ignore: [ '**.md' ]
pull_request:
branches: [ "main" ]
paths-ignore: [ '**.md' ]
env:
config: Release
fakeWebJobsPackageVersion: 99.99.99-test
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Docker Build - Chat Bot Sample Out of proc
run: docker build -f samples/chat/csharp-ooproc/Dockerfile -t openai-func-sample-csharp-ooproc .
- name: Docker Run - Azurite
run: docker run -d -p 10000:10000 -p 10001:10001 -p 10002:10002 mcr.microsoft.com/azure-storage/azurite
- name: Docker Run - Chat Bot Sample Out of Proc
env:
AZURE_OPENAI_KEY: ${{ secrets.AZURE_OPENAI_KEY }}
AZURE_OPENAI_ENDPOINT: ${{ vars.AZURE_OPENAI_ENDPOINT }}
AZURE_DEPLOYMENT_NAME: ${{ vars.AZURE_DEPLOYMENT_NAME }}
run: |
docker run -d -p 7071:80 --name openai-func-sample-csharp-ooproc \
--add-host host.docker.internal:host-gateway \
--env AZURE_OPENAI_KEY=$AZURE_OPENAI_KEY \
--env AZURE_OPENAI_ENDPOINT=$AZURE_OPENAI_ENDPOINT \
--env AZURE_DEPLOYMENT_NAME=$AZURE_DEPLOYMENT_NAME \
--env 'AzureWebJobsStorage=UseDevelopmentStorage=true;DevelopmentStorageProxyUri=http://host.docker.internal' \
openai-func-sample-csharp-ooproc
- name: Sleep for 10 seconds
run: sleep 10s
- name: Create new directory
run: mkdir ~/NuGetPackagesLocal
- name: Create/Copy NuGet Package to local directory and Build
run: |
dotnet build /home/runner/work/azure-functions-openai-extension/azure-functions-openai-extension/src/WebJobs.Extensions.OpenAI/WebJobs.Extensions.OpenAI.csproj --configuration $config -p:FileVersionRevision=$GITHUB_RUN_NUMBER -p:WebJobsVersion=$fakeWebJobsPackageVersion -p:Version=$fakeWebJobsPackageVersion
sudo cp "/home/runner/work/azure-functions-openai-extension/azure-functions-openai-extension/src/WebJobs.Extensions.OpenAI/bin/Release/Microsoft.Azure.WebJobs.Extensions.OpenAI.${fakeWebJobsPackageVersion}.nupkg" ~/NuGetPackagesLocal
dotnet nuget add source ~/NuGetPackagesLocal
dotnet nuget list source
dotnet build --configuration $config /p:WebJobsVersion=$fakeWebJobsPackageVersion;FileVersionRevision=$GITHUB_RUN_NUMBER
- name: E2E Test - Out of Proc Chat Bot Sample
run: dotnet test --configuration $config --no-build --verbosity normal
- name: Print Docker Logs - Out of Proc Chat Bot Sample
run: docker logs openai-func-sample-csharp-ooproc
if: always()
- name: Upload
uses: actions/upload-artifact@v3
with:
name: nuget-packages
path: artifacts/*.nupkg