Skip to content

Feat: 전역 예외 핸들러 구현 #347

Feat: 전역 예외 핸들러 구현

Feat: 전역 예외 핸들러 구현 #347

Workflow file for this run

name: 🚀 CI/CD workflow
on:
push:
branches:
- main
- feat/*
- chore/*
pull_request:
branches:
- main
permissions:
contents: write
checks: write
pull-requests: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
outputs:
tests_passed: ${{ steps.test-status.outputs.tests_passed }}
env:
ConnectionStrings__openai: ${{ secrets.OPENAI_CONNECTION_STRING }}
AZURE_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ vars.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }}
AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }}
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
steps:
- name: 🧑‍💻 Checkout Repository
uses: actions/checkout@v4
- name: 🧑‍💻 Checkout MCP Server
uses: actions/checkout@v4
with:
repository: microsoft/markitdown
path: src/InterviewAssistant.McpMarkItDown
- name: 🔧 Set Up .NET Core SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.x'
- name: 🔐 Trust ASP.NET Core Developer Certificate
run: dotnet dev-certs https --trust
- name: 🛠️ Install azd
uses: Azure/setup-azd@v2
- name: 🛠️ Install trx2junit Tool
if: github.event_name == 'pull_request'
run: dotnet tool install --global trx2junit
- name: 📦 Restore Dependencies
run: dotnet restore
- name: 🔧 Configure Test Environment Variables
run: echo "ConnectionStrings__applicationinsights=InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://example.com" >> $GITHUB_ENV
- name: 🏗️ Build Project
run: dotnet build --configuration Release
- name: 🧪 Run All Tests
id: run-tests
run: |
mkdir -p ./test-results
all_tests_passed=true
for proj in $(find test -name "*.csproj"); do
proj_name=$(basename $proj .csproj)
if ! dotnet test "$proj" --configuration Release --logger "trx;LogFileName=${proj_name}.trx" --results-directory ./test-results; then
all_tests_passed=false
fi
done
echo "all_tests_passed=${all_tests_passed}" >> $GITHUB_OUTPUT
shell: bash
- name: 📊 Set Test Status
id: test-status
run: |
if [ "${{ steps.run-tests.outputs.all_tests_passed }}" == "true" ]; then
echo "tests_passed=true" >> $GITHUB_OUTPUT
else
echo "tests_passed=false" >> $GITHUB_OUTPUT
echo "❌ Some tests failed. Deployment will be skipped."
fi
- name: 🔄 Convert Test Results to JUnit Format
if: github.event_name == 'pull_request'
run: find ./test-results -name '*.trx' -exec trx2junit {} \;
- name: 📑 Publish Test Results as PR Comment
if: github.event_name == 'pull_request'
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: '**/test-results/*.xml'
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: ✅ Add Check Comments for Failed Code Lines
if: github.event_name == 'pull_request'
uses: mikepenz/action-junit-report@v3
with:
report_paths: '**/test-results/*.xml'
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: ❌ Fail Workflow if Tests Failed
if: steps.test-status.outputs.tests_passed == 'false'
run: |
echo "Tests failed. Failing the workflow."
exit 1
- name: 🚀 Log in with Azure (Federated Credentials)
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.test-status.outputs.tests_passed == 'true'
shell: pwsh
run: |
azd auth login `
--client-id "$Env:AZURE_CLIENT_ID" `
--federated-credential-provider "github" `
--tenant-id "$Env:AZURE_TENANT_ID"
- name: 🏗️ Provision Infrastructure
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.test-status.outputs.tests_passed == 'true'
run: azd provision --no-prompt
env:
AZD_INITIAL_ENVIRONMENT_CONFIG: ${{ secrets.AZD_INITIAL_ENVIRONMENT_CONFIG }}
- name: 🔧 Set Azure Environment Variables
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.test-status.outputs.tests_passed == 'true'
shell: pwsh
run: |
azd env set ConnectionStrings__openai "$Env:ConnectionStrings__openai"
- name: 🚢 Deploy & Update Infrastructure
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.test-status.outputs.tests_passed == 'true'
run: azd up --no-prompt
env:
EnableAzureMonitoring: "true"