Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
218 changes: 12 additions & 206 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,15 @@ jobs:
export PACKAGE_VERSION="$CURRENT_DATE-preview.${{ github.run_number }}"
echo "Package version is ${PACKAGE_VERSION}"
echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_OUTPUT
export PYTHON_PACKAGE_VERSION="$CURRENT_DATE+preview.${{ github.run_number }}"
echo "Python package version is ${PYTHON_PACKAGE_VERSION}"
echo "PYTHON_PACKAGE_VERSION=${PYTHON_PACKAGE_VERSION}" >> $GITHUB_OUTPUT

outputs:
BUILD_VERSION: ${{ steps.build_version.outputs.BUILD_VERSION }}
PACKAGE_VERSION: ${{ steps.package_version.outputs.PACKAGE_VERSION }}
PYTHON_PACKAGE_VERSION: ${{ steps.package_version.outputs.PYTHON_PACKAGE_VERSION }}

changed-sdks:
name: Determine Changed SDKs
runs-on: ubuntu-latest
outputs:
python-sdk: ${{ steps.check_python_sdk.outputs.changed }}
nodejs-sdk: ${{ steps.check_nodejs_sdk.outputs.changed }}
dotnet-sdk: ${{ steps.check_dotnet_sdk.outputs.changed }}
steps:
- name: Checkout repository
Expand All @@ -62,28 +56,6 @@ jobs:
echo "head=${{ github.sha }}" >> "$GITHUB_OUTPUT"
fi

- id: check_python_sdk
name: Check Python SDK changes
run: |
if git diff --name-only "${{ steps.git_refs.outputs.base }}" "${{ steps.git_refs.outputs.head }}" -- 'python/**' | grep -q .; then
echo "Python SDK changes detected"
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "No Python SDK changes detected"
echo "changed=false" >> $GITHUB_OUTPUT
fi

- id: check_nodejs_sdk
name: Check Node.js SDK changes
run: |
if git diff --name-only "${{ steps.git_refs.outputs.base }}" "${{ steps.git_refs.outputs.head }}" -- 'nodejs/**' | grep -q .; then
echo "Node.js SDK changes detected"
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "No Node.js SDK changes detected"
echo "changed=false" >> $GITHUB_OUTPUT
fi

- id: check_dotnet_sdk
name: Check .NET SDK changes
run: |
Expand All @@ -95,123 +67,13 @@ jobs:
echo "changed=false" >> $GITHUB_OUTPUT
fi

python-sdk:
name: Python SDK
needs: [version-number, changed-sdks]
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./python

strategy:
matrix:
python-version: ['3.11', '3.12']

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install the latest version of uv and set the python version
uses: astral-sh/setup-uv@v6
with:
version: '0.6.x'
python-version: ${{ matrix.python-version }}
working-directory: ./python
enable-cache: true
cache-dependency-glob: "./pyproject.toml"

- name: Install the project
run: uv lock && uv sync --locked --all-extras --dev

- name: Check linting
run: |
uv run --frozen ruff check .
continue-on-error: true

- name: Check formatting
run: |
uv run --frozen ruff format --check .

- name: Build package
run: |
A365_SDK_VERSION=${{ needs.version-number.outputs.PYTHON_PACKAGE_VERSION }} uv build --all-packages --wheel

- name: Run tests
run: |
uv run --frozen python -m pytest tests/ -v --tb=short

# Copy package and samples to drop folder
- name: Copy package and samples to drop folder
run: |
mkdir -p ~/drop/python-${{ matrix.python-version }}/dist && cp -v dist/*.whl $_
mkdir -p ~/drop/python-${{ matrix.python-version }}/samples && cp -rv samples/sample_openai_agent $_

# Zip files since upload-artifact does not seem like to like folders
- name: Create zip
run: cd ~/drop/python-${{ matrix.python-version }} && zip -r ~/drop/python-${{ matrix.python-version }}.zip .

- name: Upload package and samples as artifacts
uses: actions/upload-artifact@v4
with:
name: python-${{ matrix.python-version }}
path: ~/drop/python-${{ matrix.python-version }}.zip

- name: Publish
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.changed-sdks.outputs.python-sdk == 'true'
run: |
uv run twine upload --config-file .pypirc -r Agent365 dist/*
continue-on-error: true
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.AZURE_DEVOPS_TOKEN }}

nodejs-sdk:
name: Node.js SDK
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./nodejs/src

strategy:
matrix:
node-version: ['18', '20']

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- name: Install dependencies
run: npm ci

- name: Lint code
run: npm run lint:all

- name: Build package
run: npm run build:all

- name: Run tests
run: npm test

# - name: Publish to NPM (commented for now)
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
# run: npm publish
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

dotnet-sdk:
name: .NET SDK
needs: [version-number, changed-sdks]
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./dotnet/sdk
working-directory: ./src

strategy:
matrix:
Expand All @@ -221,78 +83,22 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
source-url: https://pkgs.dev.azure.com/msazure/OneAgile/_packaging/Agent365/nuget/v3/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.AZURE_DEVOPS_TOKEN }}
# - name: Setup .NET ${{ matrix.dotnet-version }}
# uses: actions/setup-dotnet@v4
# with:
# dotnet-version: ${{ matrix.dotnet-version }}
# source-url: https://pkgs.dev.azure.com/msazure/OneAgile/_packaging/Agent365/nuget/v3/index.json
# env:
# NUGET_AUTH_TOKEN: ${{ secrets.AZURE_DEVOPS_TOKEN }}

- name: Restore dependencies
run: dotnet restore Microsoft.Kairo.Sdk.sln
run: dotnet restore Microsoft.Agents.A365.sln

- name: Build solution
run: dotnet build Microsoft.Kairo.Sdk.sln --no-restore --configuration Release /p:Version=${{ needs.version-number.outputs.BUILD_VERSION }}
run: dotnet build Microsoft.Agents.A365.sln --no-restore --configuration Release /p:Version=${{ needs.version-number.outputs.BUILD_VERSION }}

- name: Run tests
run: dotnet test Microsoft.Kairo.Sdk.sln --no-build --configuration Release --verbosity normal
run: dotnet test Microsoft.Agents.A365.sln --no-build --configuration Release --verbosity normal

- name: Pack NuGet packages
run: dotnet pack Microsoft.Kairo.Sdk.sln --no-build --configuration Release --output ../NuGetPackages /p:PackageVersion=${{ needs.version-number.outputs.PACKAGE_VERSION }}

# Copy samples to drop folder
- name: Copy NuGet packages and samples to drop folder
run: |
mkdir -p ~/drop/dotnet/NuGetPackages && cp -v ../NuGetPackages/*.nupkg $_
mkdir -p ~/drop/dotnet/samples && cp -rv ../samples/hello_world_a365_agent $_
mkdir -p ~/drop/dotnet/samples && cp -rv ../samples/semantic-kernel-multiturn $_

# Build samples that depend on the NuGet packages
- name: Build HelloWorldA365Agent
run: |
dotnet build ../samples/hello_world_a365_agent/HelloWorldA365Agent.sln --configuration Release

- name: Build semantic-kernel-multiturn
run: |
dotnet build ../samples/semantic-kernel-multiturn/SemanticKernelMultiturn.csproj --configuration Release

# Zip files since upload-artifact does not seem like to like folders
- name: Create zip
run: cd ~/drop/dotnet && zip -r ~/drop/dotnet.zip .

- name: Upload NuGet packages and samples as artifacts
uses: actions/upload-artifact@v4
with:
name: dotnet
path: ~/drop/dotnet.zip

- name: Publish
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.changed-sdks.outputs.dotnet-sdk == 'true'
env:
NUGET_AUTH_TOKEN: ${{ secrets.AZURE_DEVOPS_TOKEN }}
run: dotnet nuget push ../NuGetPackages/*.nupkg --api-key AzureDevOps --source https://pkgs.dev.azure.com/msazure/OneAgile/_packaging/Agent365/nuget/v3/index.json

dotnet-samples:
name: .NET Samples
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./dotnet/samples/

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'

- name: Build basic_agent (KairoSample)
run: |
dotnet build basic_agent/KairoSample.sln --configuration Release

- name: Build devin_agent (Devin AI PoC)
run: |
dotnet build devin_agent/devin-ai-poc.sln --configuration Release
run: dotnet pack Microsoft.Agents.A365.sln --no-build --configuration Release --output ../NuGetPackages /p:PackageVersion=${{ needs.version-number.outputs.PACKAGE_VERSION }}
32 changes: 0 additions & 32 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,38 +61,6 @@ CodeCoverage/
TestResult.xml
nunit-*.xml

# Python build artifacts
*.egg-info/
__pycache__/
*.py[cod]
*$py.class
*.pyc
*.pyo
*.pyd
dist/
build/
.eggs/
.pytest_cache/
_version.py

# Virtual environments
.venv/
venv/
env/
.env
.env/
*.env

# JavaScript/Node.js build artifacts
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
package-lock.json.bak
.cache/
.next/
out/
coverage/

# We should have at some point .vscode, but for not ignore since we don't have standard
.vscode
Expand Down
Loading
Loading