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-locking-cil/.gitlab-ci.yml

52 lines
1.6 KiB
YAML
Raw Normal View History

2021-01-22 00:02:19 +00:00
stages:
2021-09-04 02:33:54 +00:00
- build
2021-01-22 00:02:19 +00:00
2021-01-22 00:25:40 +00:00
default:
before_script:
2021-01-22 00:28:50 +00:00
- curl -sL https://deb.nodesource.com/setup_15.x | bash -
2021-01-22 00:32:14 +00:00
- apt-get install -y nodejs
2021-01-22 00:25:40 +00:00
2021-09-04 02:33:54 +00:00
build:
2021-01-22 00:02:19 +00:00
image: mcr.microsoft.com/dotnet/sdk:5.0
2021-09-04 02:33:54 +00:00
stage: build
2021-01-22 00:02:19 +00:00
script:
2021-09-04 02:33:54 +00:00
# Set up the environment.
- npx npm install --ci
- npx commitlint-gitlab-ci -x @commitlint/config-conventional
2021-01-22 00:02:19 +00:00
2021-09-04 02:33:54 +00:00
# Build and test everything.
2021-01-22 00:02:19 +00:00
- dotnet restore
- dotnet build
- 'dotnet test --test-adapter-path:. --logger:"junit;LogFilePath=../artifacts/{assembly}-test-result.xml;MethodFormat=Default;FailureBodyFormat=Verbose" --collect:"XPlat Code Coverage"'
# Summarize the output for Gitlab CI reporting.
- dotnet new tool-manifest
- dotnet tool install dotnet-reportgenerator-globaltool
- dotnet tool run reportgenerator -reports:src/*/TestResults/*/coverage.cobertura.xml -targetdir:./coverage "-reporttypes:Cobertura;TextSummary"
- grep "Line coverage" coverage/Summary.txt
2021-09-04 02:33:54 +00:00
# Perform the release.
- npx semantic-release
2021-01-22 00:02:19 +00:00
rules:
2021-09-04 02:33:54 +00:00
- if: '$CI_COMMIT_TITLE =~ /^chore\(release\)/'
2021-01-22 00:02:19 +00:00
when: never
- if: '$CI_COMMIT_TAG'
when: never
2021-09-04 02:33:54 +00:00
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never
2021-01-22 00:02:19 +00:00
- when: on_success
2021-09-04 02:33:54 +00:00
2021-01-22 00:02:19 +00:00
artifacts:
when: always
paths:
- ./**/*test-result.xml
- ./coverage/Cobertura.xml
- ./coverage/Summary.*
2021-09-04 02:33:54 +00:00
- ./**/*.nupkg
2021-01-22 00:02:19 +00:00
reports:
junit:
- ./**/*test-result.xml
cobertura:
- ./coverage/Cobertura.xml