Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi framework builds using CircleCI #59

Merged
merged 4 commits into from
Apr 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 64 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,91 @@ orbs:

build:
jobs:

run-build:
executor: dotnet-build-executor
parameters:
image-tag:
description: The .NET Core SDK image tag to use.
type: string
build-config:
description: The build configuration, either Debug or Release.
type: string
framework:
description: The .NET Core App framework target.
type: string
executor:
name: dotnet-build-executor
tag: << parameters.image-tag >>
steps:
- checkout
- run:
name: Restore
command: dotnet restore
- run:
name: Build
command: dotnet build --no-restore -f netcoreapp2.0 -c Debug ./test/Castle.Core.AsyncInterceptor.Tests/Castle.Core.AsyncInterceptor.Tests.csproj
command: dotnet build --no-restore -f << parameters.framework >> -c << parameters.build-config >> ./test/Castle.Core.AsyncInterceptor.Tests/Castle.Core.AsyncInterceptor.Tests.csproj
- run:
name: Test
command: dotnet test --no-restore --no-build -c Debug -f netcoreapp2.0 ./test/Castle.Core.AsyncInterceptor.Tests/Castle.Core.AsyncInterceptor.Tests.csproj
command: dotnet test --no-restore --no-build -f << parameters.framework >> -c << parameters.build-config >> ./test/Castle.Core.AsyncInterceptor.Tests/Castle.Core.AsyncInterceptor.Tests.csproj

# The --no-restore parameter was added in .NET Core 2, so add a dedicated job for building .NET Core 1.1
run-build-1-1:
parameters:
build-config:
description: The build configuration, either Debug or Release.
type: string
executor:
name: dotnet-build-executor
tag: "1.1"
steps:
- checkout
- run:
name: Restore
command: dotnet restore
- run:
name: Build
command: dotnet build -f netcoreapp1.1 -c << parameters.build-config >> ./test/Castle.Core.AsyncInterceptor.Tests/Castle.Core.AsyncInterceptor.Tests.csproj
- run:
name: Test
command: dotnet test --no-build -f netcoreapp1.1 -c << parameters.build-config >> ./test/Castle.Core.AsyncInterceptor.Tests/Castle.Core.AsyncInterceptor.Tests.csproj

executors:

dotnet-build-executor:
parameters:
tag:
description: The .NET Core SDK image tag to use.
type: string
default: "2.2"
docker:
- image: mcr.microsoft.com/dotnet/core/sdk:<<parameters.tag>>

workflows:

"Build All Frameworks":
jobs:
- build/run-build-1-1:
name: 1.1 Debug Build
build-config: Debug
- build/run-build-1-1:
name: 1.1 Release Build
build-config: Release
- build/run-build:
name: 2.1 Debug Build
image-tag: "2.1"
build-config: Debug
framework: netcoreapp2.0
- build/run-build:
name: 2.1 Release Build
image-tag: "2.1"
build-config: Release
framework: netcoreapp2.0
- build/run-build:
name: 2.2 Debug Build
image-tag: "2.2"
build-config: Debug
framework: netcoreapp2.0
- build/run-build:
name: "Build .NET Core 2.2"
filters:
branches:
only:
- master
- /pull\/.*/
name: 2.2 Release Build
image-tag: "2.2"
build-config: Release
framework: netcoreapp2.0
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![NuGet Version](https://img.shields.io/nuget/v/Castle.Core.AsyncInterceptor.svg)](https://www.nuget.org/packages/Castle.Core.AsyncInterceptor "NuGet Version")
[![Build status](https://img.shields.io/appveyor/ci/JSkimming/castle-core-asyncinterceptor/master.svg?label=Windows)](https://ci.appveyor.com/project/JSkimming/castle-core-asyncinterceptor "AppVeyor build status")
[![Travis build Status](https://img.shields.io/travis/JSkimming/Castle.Core.AsyncInterceptor/master.svg?label=Linux/Mac)](https://travis-ci.org/JSkimming/Castle.Core.AsyncInterceptor "Travis build status")
[![CircleCI build Status](https://img.shields.io/circleci/project/github/JSkimming/Castle.Core.AsyncInterceptor/master.svg?label=CircleCI)](https://circleci.com/gh/JSkimming/Castle.Core.AsyncInterceptor/tree/master "CircleCI build Status")
[![codecov](https://img.shields.io/codecov/c/github/JSkimming/Castle.Core.AsyncInterceptor/master.svg)](https://codecov.io/gh/JSkimming/Castle.Core.AsyncInterceptor "Code coverage")
[![Latest release](https://img.shields.io/github/release/JSkimming/Castle.Core.AsyncInterceptor.svg)](https://github.com/JSkimming/Castle.Core.AsyncInterceptor/releases "Latest release")
<!--[![Coverity Scan Status](https://img.shields.io/coverity/scan/4829.svg)](https://scan.coverity.com/projects/4829 "Coverity Scan Status")-->
Expand Down