Add convenience layer to FineTuning with tests #1401
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 and Test | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, reopened, synchronize] | |
jobs: | |
build: # Test, pack and publish the Open AI nuget package as a build artifact | |
runs-on: ubuntu-latest | |
env: | |
version_suffix_args: ${{ format('--version-suffix="alpha.{0}"', github.run_number) }} | |
steps: | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.x | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Build | |
run: dotnet build | |
-c Release | |
${{ env.version_suffix_args }} | |
working-directory: .dotnet | |
- name: Test | |
run: dotnet test | |
--no-build | |
--configuration Release | |
--filter="TestCategory~${{ github.event_name == 'pull_request' && 'Offline' || 'Online' }}|TestCategory~Smoke" | |
--logger "trx;LogFileName=${{github.workspace}}/artifacts/test-results/full.trx" | |
env: | |
SECRET_VALUE: ${{ secrets.OPENAI_TOKEN }} | |
working-directory: .dotnet | |
- name: Run additional code checks | |
shell: pwsh | |
run: ./Run-Checks.ps1 | |
working-directory: .scripts | |
- name: Pack | |
run: dotnet pack | |
--no-build | |
--configuration Release | |
--output "${{github.workspace}}/artifacts/packages" | |
${{ env.version_suffix_args }} | |
working-directory: .dotnet | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-artifacts | |
path: ${{github.workspace}}/artifacts | |
- name: NuGet Autenticate | |
if: github.event_name != 'pull_request' | |
run: dotnet nuget add source | |
"https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" | |
--name "github" | |
--username ${{ github.actor }} | |
--password ${{ secrets.GITHUB_TOKEN }} | |
--store-password-in-clear-text | |
working-directory: .dotnet | |
- name: Publish | |
if: github.event_name != 'pull_request' | |
run: dotnet nuget push | |
${{github.workspace}}/artifacts/packages/*.nupkg | |
--source "github" | |
--api-key ${{ secrets.GITHUB_TOKEN }} | |
--skip-duplicate | |
working-directory: .dotnet | |
azure_build: # Development mirror only; validate AOAI compilation | |
strategy: | |
matrix: | |
# Builds on all supported .Net versions on all supported OS platforms. It also | |
# distributes the tests across these OSes. | |
os_net: | |
- runs-on: ubuntu-latest | |
test_framework: net8.0 | |
- runs-on: macos-latest | |
test_framework: net6.0 | |
- runs-on: windows-latest | |
test_framework: net462 | |
runs-on: ${{ matrix.os_net.runs-on }} | |
steps: | |
- name: Setup .NET 6 and .Net 8 | |
uses: actions/setup-dotnet@v4 | |
with: | |
# .Net Framework 4.6.2 is pre-installed on Windows 10 versions 1607 and newer | |
dotnet-version: | | |
6.x | |
8.x | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Build | |
run: dotnet build -p:Configuration=unsigned | |
working-directory: .dotnet.azure/sdk/openai | |
- name: Test (${{ matrix.os_net.test_framework }}) | |
run: >- | |
dotnet test | |
--framework ${{ matrix.os_net.test_framework }} | |
--no-build | |
--filter "(TestCategory!=Live)" | |
--logger "trx;LogFileName=Azure.AI.OpenAI.Tests.trx" | |
--logger:"console;verbosity=quiet" | |
--blame-crash-dump-type full | |
--blame-hang-dump-type full | |
--blame-hang-timeout 15minutes | |
--results-directory "${{github.workspace}}/TestResults" | |
Azure.AI.OpenAI/tests/Azure.AI.OpenAI.Tests.csproj | |
working-directory: .dotnet.azure/sdk/openai | |
- name: Publish test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: TestResults-${{ matrix.os_net.runs-on }}-${{ matrix.os_net.test_framework }} | |
path: TestResults | |
if: ${{ always() }} |