Skip to content

Commit e49cb25

Browse files
committed
removed cake and setup workflow
1 parent d3eafab commit e49cb25

File tree

4 files changed

+72
-83
lines changed

4 files changed

+72
-83
lines changed

.config/dotnet-tools.json

-12
This file was deleted.

.github/workflows/main.yml

+72-18
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,86 @@
1-
# This is a basic workflow to help you get started with Actions
1+
# This workflow will build a .NET project
22

33
name: CI
44

5-
# Controls when the workflow will run
65
on:
7-
# Triggers the workflow on push or pull request events but only for the "main" branch
86
push:
9-
branches: [ "main", "develop", "/release/.*/", "/hotfix/.*/" ]
7+
branches:
8+
- master
9+
- develop
10+
- "feature/**"
11+
- "release/**"
12+
- "hotfix/**"
13+
tags:
14+
- "*"
1015
pull_request:
11-
branches: [ "main", "develop", "/release/.*/", "/hotfix/.*/" ]
1216

13-
# Allows you to run this workflow manually from the Actions tab
14-
workflow_dispatch:
17+
defaults:
18+
run:
19+
working-directory: src
1520

16-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1721
jobs:
18-
# This workflow contains a single job called "build"
1922
build:
20-
# The type of runner that the job will run on
21-
runs-on: ubuntu-latest
23+
env:
24+
BUILD_CONFIG: "Release"
25+
26+
runs-on: ${{ matrix.os }}
27+
strategy:
28+
matrix:
29+
os: [windows-latest, ubuntu-latest, macos-latest]
2230

23-
# Steps represent a sequence of tasks that will be executed as part of the job
2431
steps:
25-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
26-
- uses: actions/checkout@v3
32+
- uses: actions/checkout@v3
2733

28-
# Runs a single command using the runners shell
29-
- name: Build Solution
30-
shell: pwsh
34+
- name: Get Build Version
3135
run: |
32-
./build.ps1
36+
Import-Module ..\build\GetBuildVersion.psm1
37+
Write-Host $Env:GITHUB_REF
38+
$version = GetBuildVersion -VersionString $Env:GITHUB_REF
39+
echo "BUILD_VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
40+
shell: pwsh
41+
42+
- name: Setup .NET
43+
uses: actions/setup-dotnet@v3
44+
with:
45+
dotnet-version: 6.0.x
46+
47+
- name: Restore dependencies
48+
run: dotnet restore
49+
50+
- name: Build
51+
run: dotnet build --configuration $BUILD_CONFIG -p:Version=$BUILD_VERSION --no-restore
52+
53+
- name: Test
54+
run: dotnet test -p:Configuration=$BUILD_CONFIG --no-restore --no-build --verbosity normal --collect:"XPlat Code Coverage"
55+
56+
- name: Codecov
57+
uses: codecov/[email protected]
58+
with:
59+
token: ${{ secrets.CODECOVACCESSTOKEN }} # not required for public repos
60+
61+
- name: Setup NuGet
62+
uses: NuGet/setup-nuget@v1
63+
64+
- name: Publish NuGet
65+
if: startsWith(github.ref, 'refs/heads/Release')
66+
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGETORGAPI}}
67+
68+
# - name: Code Coverage Report
69+
# uses: irongut/[email protected]
70+
# with:
71+
# filename: coverage/**/coverage.cobertura.xml
72+
# badge: true
73+
# fail_below_min: true
74+
# format: markdown
75+
# hide_branch_rate: false
76+
# hide_complexity: true
77+
# indicators: true
78+
# output: both
79+
# thresholds: "60 80"
80+
81+
# - name: Add Coverage PR Comment
82+
# uses: marocchino/sticky-pull-request-comment@v2
83+
# if: github.event_name == 'pull_request'
84+
# with:
85+
# recreate: true
86+
# path: code-coverage-results.md

build.cake

-40
This file was deleted.

build.ps1

-13
This file was deleted.

0 commit comments

Comments
 (0)