-
Notifications
You must be signed in to change notification settings - Fork 30
70 lines (55 loc) · 2.23 KB
/
build.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
60
61
62
63
64
65
66
67
68
69
70
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: |
dotnet build OpenAI-Extension.sln --configuration $config /p:WebJobsVersion=99.99.99;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