Skip to content

Commit

Permalink
Merge branch 'main' into umeshma/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
umeshma committed Jan 30, 2025
2 parents 8074357 + 9dd2d10 commit e978131
Show file tree
Hide file tree
Showing 23 changed files with 254 additions and 236 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build-ts-pull-request-target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ name: build-ts

on:
# Manual approval of forked environments is required
pull_request_target:
branches:
- main
# pull_request_target:
# branches:
# - main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
run: |
Xvfb :99 -screen 0 1600x1200x24 & export DISPLAY=:99
npx playwright test simple.spec.ts
rm ../../.env
rm ../../.env
working-directory: ts/packages/shell
continue-on-error: true
- name: Live Tests
Expand All @@ -122,4 +122,4 @@ jobs:
run: |
npm run test:live
working-directory: ts
continue-on-error: true
continue-on-error: true
26 changes: 13 additions & 13 deletions .github/workflows/shell-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,59 +40,59 @@ jobs:
- name: Setup Git LF
run: |
git config --global core.autocrlf false
- uses: actions/checkout@v4

- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
ts:
- "ts/**"
- ".github/workflows/build-ts.yml"
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
package_json_file: ts/package.json

- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.version }}
cache: "pnpm"
cache-dependency-path: ts/pnpm-lock.yaml

- name: Install dependencies (pnpm)
working-directory: ts
run: |
pnpm install --frozen-lockfile --strict-peer-dependencies
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
working-directory: ts/packages/shell

- name: Build repo
working-directory: ts
run: |
npm run build
- name: Login to Azure
uses: azure/[email protected]
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_5B0D2D6BA40F4710B45721D2112356DD }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_39BB903136F14B6EAD8F53A8AB78E3AA }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_F36C1F2C4B2C49CA8DD5C52FAB98FA30 }}

- name: Get Keys
run: |
node tools/scripts/getKeys.mjs --vault build-pipeline-kv
working-directory: ts

- name: Test CLI - verify .env & endpoint connectivity
run: |
npm run start:dev 'prompt' 'why is the sky blue'
working-directory: ts/packages/cli

- name: Shell Tests (windows)
if: ${{ runner.os == 'windows' }}
timeout-minutes: 60
Expand All @@ -110,10 +110,10 @@ jobs:
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
Xvfb :99 -screen 0 1600x1200x24 & export DISPLAY=:99
npm run shell:test
rm ../../.env
rm ../../.env
working-directory: ts/packages/shell
continue-on-error: true

- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
Expand Down
33 changes: 12 additions & 21 deletions .github/workflows/smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
# pull_request:
# branches: ["main"]
pull_request_target:
branches: ["main"]
branches: ["main"]
merge_group:
branches: ["main"]

Expand All @@ -31,7 +31,7 @@ env:

jobs:
shell_and_cli:
#environment: ${{ github.event_name == 'pull_request_target' && 'development-fork' || 'development' }} # required for federated credentials
#environment: ${{ github.event_name == 'pull_request_target' && 'development-fork' || 'development' }} # required for federated credentials
environment: development-fork
strategy:
fail-fast: false
Expand All @@ -42,7 +42,7 @@ jobs:

runs-on: ${{ matrix.os }}
steps:
- if: runner.os == 'Linux'
- if: runner.os == 'Linux'
run: |
sudo apt install libsecret-1-0
Expand All @@ -54,9 +54,9 @@ jobs:
uses: actions/checkout@v4

- if: ${{ github.event_name == 'pull_request_target'}}
uses: actions/checkout@v4
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
ref: ${{ github.event.pull_request.head.sha }}

- uses: dorny/paths-filter@v3
id: filter
Expand Down Expand Up @@ -114,37 +114,28 @@ jobs:
timeout-minutes: 60
run: |
npm run shell:smoke
rm ../../.env
working-directory: ts/packages/shell
continue-on-error: true

- name: Shell Tests - smoke (linux)
if: ${{ runner.os == 'Linux' }}
timeout-minutes: 60
# https://github.com/microsoft/playwright/issues/34251 - sysctl command
run: |
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
Xvfb :99 -screen 0 1600x1200x24 & export DISPLAY=:99
npm run shell:smoke
rm ../../.env
working-directory: ts/packages/shell
continue-on-error: true

# - name: Shell Tests - smoke (linux)
# if: ${{ runner.os == 'Linux' }}
# timeout-minutes: 60
# # https://github.com/microsoft/playwright/issues/34251 - sysctl command
# run: |
# sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
# xvfb-run --auto-servernum --server-args="-screen 0 16001200x24" -- npm run shell:smoke
# rm ../../.env
# working-directory: ts/packages/shell
# continue-on-error: true

- name: Live Tests
if: ${{ runner.os == 'linux' }}
timeout-minutes: 60
run: |
npm run test:live
working-directory: ts
continue-on-error: true
continue-on-error: true

- name: Clean up Keys
run: |
rm ./.env
working-directory: ts
if: always()
157 changes: 74 additions & 83 deletions pipelines/azure-build-ts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,89 +20,80 @@ pr:
- "*"

pool:
vmImage: 'ubuntu-latest'
vmImage: "ubuntu-latest"

variables:
node_version: '18'
pnpm_version: '9.0.0'
workingDirectory: 'ts'
agentsdk_folder: 'ts/packages/agentSdk'

workingDirectory: "ts"
agentsdk_folder: "ts/packages/agentSdk"

jobs:
- job: build_ts
displayName: 'Build TypeScript Project'
strategy:
matrix:
node_20:
nodeVersion: '20'
steps:
- checkout: TypeAgent-GH
displayName: 'Checkout TypeAgent Repository'
path: 'typeagent'

- template: include-install-pnpm.yml
parameters:
buildDirectory: $(Build.SourcesDirectory)/ts

- script: |
curl -fsSL https://get.pnpm.io/v6.14.js | node - add --global pnpm@$(pnpm_version)
export PNPM_HOME="$HOME/.local/share/pnpm"
export PATH="$PNPM_HOME:$PATH"
displayName: 'Install pnpm'
condition: always()
- task: UseNode@1
displayName: 'Setup Node.js'
inputs:
version: $(nodeVersion)
checkLatest: true

- script: |
pnpm install --frozen-lockfile --strict-peer-dependencies
displayName: 'Install dependencies'
workingDirectory: $(workingDirectory)
- script: |
current_version=$(node -p "require('./package.json').version")
new_version="${current_version}-$(Build.BuildId)"
echo "##vso[task.setvariable variable=package_version]$new_version"
jq ".version=\"$new_version\"" package.json > package.tmp.json
mv package.tmp.json package.json
echo "Updated package.json to version $new_version"
cat package.json
displayName: 'Update Package Version'
workingDirectory: $(agentsdk_folder)
- script: |
npm run build
displayName: 'Build'
workingDirectory: $(workingDirectory)
- script: |
npm run test
displayName: 'Run Tests'
workingDirectory: $(workingDirectory)
- script: |
npm run lint
displayName: 'Lint'
workingDirectory: $(workingDirectory)
- script: |
echo $(ADO_REGISTRY)
echo "registry=$(ADO_REGISTRY)" > .npmrc
echo "always-auth=true" >> .npmrc
cat .npmrc
displayName: 'Create .npmrc file.'
workingDirectory: $(agentsdk_folder)
- task: npmAuthenticate@0
inputs:
workingFile: '$(agentsdk_folder)/.npmrc'
displayName: 'Authenticate with Azure Artifacts'

- script: |
cd $(Build.SourcesDirectory)/$(agentsdk_folder)
npm publish --registry=$(ADO_REGISTRY)
displayName: 'Pack and Publish agent-sdk Module'
condition: succeeded()
- job: build_ts
displayName: "Build TypeScript Project"
strategy:
matrix:
node_22:
nodeVersion: "22"
steps:
- checkout: TypeAgent-GH
displayName: "Checkout TypeAgent Repository"
path: "typeagent"

- template: include-install-pnpm.yml
parameters:
buildDirectory: $(Build.SourcesDirectory)/ts

- task: UseNode@1
displayName: "Setup Node.js"
inputs:
version: $(nodeVersion)
checkLatest: true

- script: |
pnpm install --frozen-lockfile --strict-peer-dependencies
displayName: "Install dependencies"
workingDirectory: $(workingDirectory)
- script: |
current_version=$(node -p "require('./package.json').version")
new_version="${current_version}-$(Build.BuildId)"
echo "##vso[task.setvariable variable=package_version]$new_version"
jq ".version=\"$new_version\"" package.json > package.tmp.json
mv package.tmp.json package.json
echo "Updated package.json to version $new_version"
cat package.json
displayName: "Update Package Version"
workingDirectory: $(agentsdk_folder)
- script: |
npm run build
displayName: "Build"
workingDirectory: $(workingDirectory)
- script: |
npm run test:local
displayName: "Run Tests (Local)"
workingDirectory: $(workingDirectory)
- script: |
npm run lint
displayName: "Lint"
workingDirectory: $(workingDirectory)
- script: |
echo $(ADO_REGISTRY)
echo "registry=$(ADO_REGISTRY)" > .npmrc
echo "always-auth=true" >> .npmrc
cat .npmrc
displayName: "Create .npmrc file."
workingDirectory: $(agentsdk_folder)
- task: npmAuthenticate@0
inputs:
workingFile: "$(agentsdk_folder)/.npmrc"
displayName: "Authenticate with Azure Artifacts"

- script: |
cd $(Build.SourcesDirectory)/$(agentsdk_folder)
npm publish --registry=$(ADO_REGISTRY)
displayName: "Pack and Publish agent-sdk Module"
condition: succeeded()
Loading

0 comments on commit e978131

Please sign in to comment.