Skip to content

Move the pipeline to ADO to allow runs from fork #264

Move the pipeline to ADO to allow runs from fork

Move the pipeline to ADO to allow runs from fork #264

Workflow file for this run

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: Restore dependencies
run: dotnet restore
- name: Main Build
run: dotnet build --configuration $config --no-restore -p:FileVersionRevision=$GITHUB_RUN_NUMBER
- name: Docker Build - Chat Bot Sample
run: docker build -f samples/chat/csharp-inproc/Dockerfile -t openai-func-sample-csharp-inproc .
- 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
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-inproc \
--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-inproc
- name: Sleep for 10 seconds
run: sleep 10s
- name: E2E Test - Chat Bot Sample
run: dotnet test --configuration $config --no-build --verbosity normal
- name: Print Docker Logs - Chat Bot Sample
run: docker logs openai-func-sample-csharp-inproc
if: always()
- name: Pack
run: dotnet pack --configuration $config --no-build --output artifacts
- name: Upload
uses: actions/upload-artifact@v3
with:
name: nuget-packages
path: artifacts/*.nupkg