Skip to content

nuget-azure-ad-b2c-backend: Bump Microsoft.NET.Test.Sdk from 17.14.1 to 18.0.1 #1878

nuget-azure-ad-b2c-backend: Bump Microsoft.NET.Test.Sdk from 17.14.1 to 18.0.1

nuget-azure-ad-b2c-backend: Bump Microsoft.NET.Test.Sdk from 17.14.1 to 18.0.1 #1878

---
# cspell:ignore danielpalme dorny nologo targetdir reporttypes
name: azure-ad-b2c-auth-sample CI
permissions:
contents: read
on:
pull_request:
branches: [main]
paths:
- 'samples/AzureADB2CAuth/**'
- '.github/workflows/samples-azure-ad-b2c-auth-ci.yml'
workflow_dispatch:
env:
BACKEND_WORKING_DIRECTORY: samples/AzureADB2CAuth/auth-backend
FRONTEND_WORKING_DIRECTORY: samples/AzureADB2CAuth/auth-frontend
jobs:
build-frontend:
name: フロントエンドアプリケーションのビルド
runs-on: ubuntu-latest
env:
NO_COLOR: "1" # 文字化け防止のためカラーコードを出力しない
defaults:
run:
working-directory: ${{ env.FRONTEND_WORKING_DIRECTORY }}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 1
- name: Use Node.js Use Node.js LTS
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: lts/*
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
cache: npm
- name: node パッケージのインストール
run: npm ci
- id: run-format-root
name: ルート直下の format の実行
run: npm run format:ci:root >> /var/tmp/format-root-result.txt 2>&1
- id: run-lint
name: lintの実行
run: npm run lint:ci:app >> /var/tmp/lint-result.txt 2>&1
- id: run-type-check
name: TypeScript の型チェック
run: npm run type-check:app >> /var/tmp/type-check-result.txt 2>&1
- id: application-build
name: アプリケーションのビルド
run: npm run build-only:dev:app >> /var/tmp/build-result.txt 2>&1
- id: run-unit-tests
name: 単体テストの実行
run: npm run test:unit:app >> /var/tmp/unit-test-result.txt 2>&1
- name: formatの結果出力
if: ${{ success() || (failure() && steps.run-format-root.conclusion == 'failure') }}
uses: ./.github/workflows/file-to-summary
with:
body: /var/tmp/format-root-result.txt
header: 'formatの結果 :pen:'
- name: lintの結果出力
if: ${{ success() || (failure() && steps.run-lint.conclusion == 'failure') }}
uses: ./.github/workflows/file-to-summary
with:
body: /var/tmp/lint-result.txt
header: 'lintの結果 :pen:'
- name: 型チェックの結果出力
if: ${{ success() || (failure() && steps.run-type-check.conclusion == 'failure') }}
uses: ./.github/workflows/file-to-summary
with:
body: /var/tmp/type-check-result.txt
header: '型チェックの結果 :pencil2:'
- name: ビルドの結果出力
if: ${{ success() || (failure() && steps.application-build.conclusion == 'failure') }}
uses: ./.github/workflows/file-to-summary
with:
body: /var/tmp/build-result.txt
header: 'ビルドの結果 :gear:'
- name: 単体テストの結果出力
if: ${{ success() || (failure() && steps.run-unit-tests.conclusion == 'failure') }}
uses: ./.github/workflows/file-to-summary
with:
body: /var/tmp/unit-test-result.txt
header: '単体テストの結果 :memo:'
build-backend:
name: バックエンドアプリケーションのビルド
runs-on: ubuntu-latest
env:
DOTNET_NOLOGO: true
BUILD_CONFIGURATION: Debug
SKIP_SPA_NODE_RESTORE: true
permissions:
checks: write
defaults:
run:
working-directory: ${{ env.BACKEND_WORKING_DIRECTORY }}
steps:
- name: ブランチのチェックアウト
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 1
- name: .NET SDK のセットアップ
uses: actions/setup-dotnet@2016bd2012dba4e32de620c46fe006a3ac9f0602 # v5.0.1
with:
dotnet-version: '10.*'
- name: NuGet パッケージの復元
run: dotnet restore
- id: application-build
name: アプリケーションのビルド
continue-on-error: true
run: |
echo '## Build Result :gear:' >> $GITHUB_STEP_SUMMARY
dotnet build --nologo --configuration ${{ env.BUILD_CONFIGURATION }} --verbosity minimal > build-result.txt
echo ':heavy_check_mark: アプリケーションのビルドに成功しました。' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat build-result.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
- name: ビルド失敗時の結果の表示
shell: bash
if: ${{ steps.application-build.outcome == 'failure' }}
run: |
echo ':x: アプリケーションのビルドに失敗しました。 ' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat build-result.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
exit 1
- id: run-tests
name: テストの実行
continue-on-error: true
run: |
echo '## Test Result :memo:' >> $GITHUB_STEP_SUMMARY
dotnet test --solution Dressca.slnx --no-build --verbosity normal --configuration ${{ env.BUILD_CONFIGURATION }} --coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml --report-xunit-trx
- id: create-test-result-report
name: テスト結果ページの作成
uses: dorny/test-reporter@fe45e9537387dac839af0d33ba56eed8e24189e8 # v2.3.0
with:
name: 'Test results'
path: '**/TestResults/*.trx'
path-replace-backslashes: 'true'
reporter: 'dotnet-trx'
only-summary: 'false'
use-actions-summary: 'true'
badge-title: 'tests'
list-suites: 'failed'
list-tests: 'failed'
max-annotations: '10'
fail-on-error: 'false'
fail-on-empty: 'true'
- id: create-coverage-report
name: コードカバレッジレポートの解析と作成
uses: danielpalme/ReportGenerator-GitHub-Action@9870ed167742d546b99962ff815fcc1098355ed8 # v5.4.11
if: ${{ success() || (failure() && steps.run-tests.conclusion == 'failure') }}
with:
reports: '**/TestResults/coverage.cobertura.xml'
targetdir: '${{ env.BACKEND_WORKING_DIRECTORY }}/CoverageReport'
reporttypes: 'MarkdownSummaryGithub'
- name: コードカバレッジの結果表示
shell: bash
if: ${{ success() || (failure() && steps.run-tests.conclusion == 'failure') }}
run: |
sed -i s/'# Summary'/'## Coverage :triangular_ruler:'/g CoverageReport/SummaryGithub.md
sed -i -e '/^## Coverage$/d' CoverageReport/SummaryGithub.md
cat CoverageReport/SummaryGithub.md >> $GITHUB_STEP_SUMMARY
- name: 単体テスト結果の確認
if: ${{ steps.create-test-result-report.outputs.conclusion == 'failure' }}
run: exit 1