openai/openai-dotnet
Publicmirrored from https://github.com/openai/openai-dotnetAvailable
.github/workflows/live-test.yml
42lines · modecode
| 1 | # This workflow is triggered by the user and runs live tests on the codebase. |
| 2 | name: Live Test |
| 3 | |
| 4 | on: |
| 5 | workflow_dispatch: |
| 6 | pull_request: |
| 7 | types: |
| 8 | - labeled |
| 9 | |
| 10 | jobs: |
| 11 | test: |
| 12 | name: Live Test |
| 13 | runs-on: ubuntu-latest |
| 14 | if: github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'live test') |
| 15 | environment: Live Testing |
| 16 | env: |
| 17 | version_suffix_args: ${{ format('/p:VersionSuffix="alpha.{0}"', github.run_number) }} |
| 18 | steps: |
| 19 | - name: Setup .NET |
| 20 | uses: actions/setup-dotnet@v3 |
| 21 | with: |
| 22 | dotnet-version: '8.x' |
| 23 | |
| 24 | - name: Checkout code |
| 25 | uses: actions/checkout@v2 |
| 26 | |
| 27 | - name: Run live tests |
| 28 | run: dotnet test ./tests/OpenAI.Tests.csproj |
| 29 | --configuration Release |
| 30 | --filter="TestCategory!=Smoke&TestCategory!=Images&TestCategory!=Uploads&TestCategory!=Moderations&TestCategory!=FineTuning&TestCategory!=Conversation&TestCategory!=Manual" |
| 31 | --logger "trx;LogFilePrefix=live" |
| 32 | --results-directory ${{github.workspace}}/artifacts/test-results |
| 33 | ${{ env.version_suffix_args}} |
| 34 | env: |
| 35 | OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} |
| 36 | |
| 37 | - name: Upload artifact |
| 38 | uses: actions/upload-artifact@v4 |
| 39 | if: ${{ !cancelled() }} |
| 40 | with: |
| 41 | name: test-artifacts |
| 42 | path: ${{github.workspace}}/artifacts |
| 43 | |