add CI for Checkin

This commit is contained in:
Suchin Sapphasitthatha 2024-12-12 15:33:43 +00:00
parent eaeaaf94b1
commit 82c6f5df4e

View file

@ -1,6 +1,6 @@
version: 37
jobs:
- name: CI for UAT
- name: CI for Checkin [UAT]
steps:
- !CheckoutStep
name: checkout code
@ -9,36 +9,54 @@ jobs:
withSubmodules: false
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !GenerateChecksumStep
name: generate package checksum
files: package-lock.json yarn.lock
name: generate project checksum
files: '**/*.csproj'
targetFile: checksum
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !SetupCacheStep
name: set up npm cache
key: node_modules_@file:checksum@
name: set up nuget cache
key: nuget_packages_@file:checksum@
loadKeys:
- node_modules
- nuget_packages
paths:
- node_modules
- /root/.nuget/packages
uploadStrategy: UPLOAD_IF_NOT_HIT
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !CommandStep
name: test and analyze
runInContainer: true
image: mcr.microsoft.com/dotnet/sdk
interpreter: !DefaultInterpreter
commands: |
set -e
dotnet tool install -g roslynator.dotnet.cli
dotnet test -l trx --collect:"XPlat Code Coverage"
#/root/.dotnet/tools/roslynator analyze -o roslynator-analysis.xml
useTTY: true
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !PublishTRXReportStep
name: publish unit test report
reportName: Unit Test
filePatterns: '**/*.trx'
condition: ALWAYS
- !PublishCoberturaReportStep
name: publish code coverage report
reportName: Code Coverage
filePatterns: '**/coverage.cobertura.xml'
condition: ALWAYS
- !PublishRoslynatorReportStep
name: publish code problem report
reportName: Code Problems
filePatterns: roslynator-analysis.xml
failThreshold: HIGH
condition: ALWAYS
- !SetBuildVersionStep
name: set build version
buildVersion: '@tag@'
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !CommandStep
name: build & test
runInContainer: true
image: node
interpreter: !DefaultInterpreter
commands: |
npm install
npm run build
useTTY: true
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !BuildImageStep
name: build docker image
dockerfile: ./docker/Dockerfile
dockerfile: ./BMA.EHR.CheckInConsumer/Dockerfile
output: !RegistryOutput
tags: hrms-git.chin.in.th/bma-hrms/hrms-api-checkin:@build_version@ hrms-git.chin.in.th/bma-hrms/hrms-api-checkin:latest
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL