Mono.gitlab-ci.yml 1.26 KB
Newer Older
Luke Bennett's avatar
Luke Bennett committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
# This is a simple gitlab continuous integration template (compatible with the shared runner provided on gitlab.com)
# using the official mono docker image to build a visual studio project.
#
# MyProject.sln
#   MyProject\
#     MyProject\
#        MyProject.csproj (console application)
#     MyProject.Test\
#        MyProject.Test.csproj (test library using nuget packages "NUnit" and "NUnit.ConsoleRunner")
#
# Please find the full example project here:
# https://gitlab.com/tobiaskoch/gitlab-ci-example-mono

# see https://hub.docker.com/_/mono/
image: mono:latest

stages:
18
  - build
Luke Bennett's avatar
Luke Bennett committed
19 20 21 22 23 24 25 26 27
  - test
  - deploy

before_script:
  - nuget restore -NonInteractive

release:
  stage: deploy
  only:
28
    - master
Luke Bennett's avatar
Luke Bennett committed
29 30 31 32 33 34 35
  artifacts:
    paths:
      - build/release/MyProject.exe
  script:
    # The output path is relative to the position of the csproj-file
    - msbuild /p:Configuration="Release" /p:Platform="Any CPU"
      /p:OutputPath="./../../build/release/" "MyProject.sln"
Matija Čupić's avatar
Matija Čupić committed
36

Luke Bennett's avatar
Luke Bennett committed
37 38 39 40 41 42
debug:
  stage: test
  script:
    # The output path is relative to the position of the csproj-file
    - msbuild /p:Configuration="Debug" /p:Platform="Any CPU"
      /p:OutputPath="./../../build/debug/" "MyProject.sln"
Matija Čupić's avatar
Matija Čupić committed
43
    - mono packages/NUnit.ConsoleRunner.3.6.0/tools/nunit3-console.exe build/debug/MyProject.Test.dll