Azoai client inheritance7 #90
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@v1 | |
with: | |
dotnet-version: 8.x | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- 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' }}" | |
--logger "trx;LogFileName=${{github.workspace}}/artifacts/test-results/full.trx" | |
env: | |
SECRET_VALUE: ${{ secrets.OPENAI_TOKEN }} | |
working-directory: .dotnet | |
- 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@v2 | |
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 |