This repository has been archived on 2023-02-02. You can view files and clone it, but cannot push or open issues or pull requests.
mfgames-toolbuilder-cil/.gitlab-ci.yml

57 lines
1.6 KiB
YAML
Raw Normal View History

2021-11-30 00:53:03 +00:00
include:
- template: Security/SAST.gitlab-ci.yml
2021-09-10 17:33:42 +00:00
stages:
- build
2021-11-30 00:53:03 +00:00
- test
- release
2021-09-10 17:33:42 +00:00
default:
before_script:
- curl -sL https://deb.nodesource.com/setup_15.x | bash -
- apt-get install -y nodejs
build:
image: mcr.microsoft.com/dotnet/sdk:5.0
stage: build
script:
# Set up the environment.
- npx npm install --ci
- npx commitlint-gitlab-ci -x @commitlint/config-conventional
- dotnet restore
- dotnet build
rules:
2021-11-30 00:53:03 +00:00
- if: $CI_COMMIT_BRANCH
2021-11-30 00:54:57 +00:00
2021-11-30 00:53:03 +00:00
test:
2021-11-30 00:59:49 +00:00
image: mcr.microsoft.com/dotnet/sdk:5.0
2021-11-30 00:53:03 +00:00
stage: test
script:
- 'dotnet test --test-adapter-path:. --logger:"junit;LogFilePath=../artifacts/{assembly}-test-result.xml;MethodFormat=Default;FailureBodyFormat=Verbose" --collect:"XPlat Code Coverage"'
- dotnet new tool-manifest
- dotnet tool install dotnet-reportgenerator-globaltool
2021-11-30 04:24:20 +00:00
- dotnet tool run reportgenerator -reports:tests/*/TestResults/*/coverage.cobertura.xml -targetdir:./coverage "-reporttypes:Cobertura;TextSummary"
2021-11-30 00:53:03 +00:00
- grep "Line coverage" coverage/Summary.txt
2021-09-10 17:33:42 +00:00
artifacts:
when: always
paths:
- ./**/*test-result.xml
- ./coverage/Cobertura.xml
- ./coverage/Summary.*
- ./**/*.nupkg
reports:
junit:
- ./**/*test-result.xml
cobertura:
- ./coverage/Cobertura.xml
2021-11-30 00:53:03 +00:00
publish:
2021-11-30 00:59:49 +00:00
image: mcr.microsoft.com/dotnet/sdk:5.0
2021-11-30 00:53:03 +00:00
stage: release
script:
- npm install --ci
- npm run build
- npx semantic-release
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH