# This workflow is triggered by the user and runs live tests on the codebase. name: Live Test on: workflow_dispatch: pull_request: types: - labeled permissions: contents: read jobs: test: name: Live Test runs-on: ubuntu-latest if: github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'live test') environment: Live Testing env: version_suffix_args: ${{ format('/p:VersionSuffix="alpha.{0}"', github.run_number) }} steps: - name: Setup .NET 10 uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0 with: dotnet-version: '10.x' - name: Setup .NET 9 uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0 with: dotnet-version: '9.x' - name: Setup .NET 8 uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0 with: dotnet-version: '8.x' - name: Checkout code uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Restore tools run: dotnet tool restore --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json - name: Run tests in Playback mode run: dotnet test ./tests/OpenAI.Tests.csproj --configuration Release --logger "trx;LogFilePrefix=playback" --results-directory ${{ github.workspace }}/artifacts/test-results ${{ env.version_suffix_args }} env: CLIENTMODEL_TEST_MODE: Playback CLIENTMODEL_DISABLE_AUTO_RECORDING: true - name: Upload artifact uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 if: ${{ !cancelled() }} with: name: test-artifacts path: ${{github.workspace}}/artifacts