Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d0582f7e
Commit
d0582f7e
authored
Feb 27, 2019
by
Piotr Wosiek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add .NET Core YAML template
parent
c44c83c4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
0 deletions
+75
-0
lib/gitlab/ci/templates/dotNET-Core.yml
lib/gitlab/ci/templates/dotNET-Core.yml
+75
-0
No files found.
lib/gitlab/ci/templates/dotNET-Core.yml
0 → 100644
View file @
d0582f7e
# This is a simple example illustrating how to build and test .NET Core project
# with GitLab Continuous Integration / Continuous Delivery.
#
# Structure of a sample project would look like this:
#
# Project
# ├── src
# │ └── ConsoleApp
# │ └── Program.cs
# └── test
# └── UnitTests
# └── BasicUnitTests.cs
# Specify the Docker image
#
# Instead of installing .NET Core SDK manually, a docker image is used
# with already pre-installed .NET Core SDK.
# The 'latest' tag targets the latest available version of .NET Core SDK image.
# If preferred, you can explicitly specify version of .NET Core e.g. using '2.2-sdk' tag.
#
# See other available tags for .NET Core: https://hub.docker.com/r/microsoft/dotnet
# Learn more about Docker tags: https://docs.docker.com/glossary/?term=tag
# and the Docker itself: https://opensource.com/resources/what-docker
image
:
microsoft/dotnet:latest
# Define stage list
#
# In this example there are only two stages.
# Initially, the project will be built and then tested.
stages
:
-
build
-
test
build
:
stage
:
build
# Restore project dependencies
#
# Before building the project all dependencies (e.g. third-party NuGet packages)
# must be restored.
#
# Jobs on GitLab.com's Shared Runners are executed on autoscaled machines.
# Each machine is used only once (for security reasons) and after this it is removed.
# What that means is that before every job a dependency restore must be performed
# because restored dependencies are removed along with machines. There are ways
# to transfer restored packages and other output binaries, but this example
# does not cover that.
#
# Learn more about GitLab job artifacts: https://docs.gitlab.com/ee/user/project/pipelines/job_artifacts.html
before_script
:
-
'
dotnet
restore'
# Build all projects discovered from solution file.
#
# Note: this may fail in case you have at least one not .NET Core based project
# defined in your solution file e.g. WCF service, which is based on .NET Framework
# not .NET Core. In such scenario you will need to build .NET Core project
# by explicitly specifying a relative path to the directory where it is located
# e.g. 'dotnet build ./src/ConsoleApp'
# Only one project path can be passed as a parameter to 'dotnet build' command.
script
:
-
'
dotnet
build'
unit tests
:
stage
:
test
# Despite the fact that the project was already built and restored,
# a dependency restore must be performed again.
before_script
:
-
'
dotnet
restore'
# Run the tests
#
# You can either run tests only for specific project (like shown below)
# or run tests for all test projects that are defined in a solution file
# with 'dotnet test'. You may want to define separate jobs for separate
# testing projects e.g. IntegrationTests, UnitTests etc.
script
:
-
'
dotnet
test
./test/UnitTests'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment