Updating pipeline to run E2E tests for ooproc #207
Workflow file for this run
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
name: Build | |
on: | |
push: | |
branches: [ "main" ] | |
paths-ignore: [ '**.md' ] | |
pull_request: | |
branches: [ "main" ] | |
paths-ignore: [ '**.md' ] | |
env: | |
config: Release | |
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 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 - 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: Get version | |
run: | | |
version=$(sed -n 's/.*<WebJobsVersion>\(.*\)<\/WebJobsVersion>.*/\1/p' /home/runner/work/azure-functions-openai-extension/azure-functions-openai-extension/src/Functions.Worker.Extensions.OpenAI/Functions.Worker.Extensions.OpenAI.csproj) | |
echo "$version" | |
newVersion="${version}-test" | |
echo "$newVersion" | |
pwd | |
dotnet nuget locals all --clear | |
dotnet new nuget.config --force | |
dotnet nuget add source /NuGetPackagesLocal | |
dotnet nuget list source | |
dotnet restore -v n | |
dotnet build /home/runner/work/azure-functions-openai-extension/azure-functions-openai-extension/src/WebJobs.Extensions.OpenAI/WebJobs.Extensions.OpenAI.csproj --configuration $config --no-restore -p:FileVersionRevision=$GITHUB_RUN_NUMBER -p:Version=$newVersion | |
sudo cp "/home/runner/work/azure-functions-openai-extension/azure-functions-openai-extension/src/WebJobs.Extensions.OpenAI/bin/Release/Microsoft.Azure.WebJobs.Extensions.OpenAI.${newVersion}.nupkg" /NuGetPackagesLocal | |
sudo cp "/home/runner/work/azure-functions-openai-extension/azure-functions-openai-extension/src/WebJobs.Extensions.OpenAI/bin/Release/Microsoft.Azure.WebJobs.Extensions.OpenAI.${newVersion}.nupkg" /home/runner/.nuget/packages | |
dotnet restore | |
dotnet build --configuration $config --no-restore -p:FileVersionRevision=$GITHUB_RUN_NUMBER -p:WebJobsVersion=$newVersion | |
- 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 |