Skip to content

Commit 1d89e55

Browse files
committed
ci: Added build workflow
1 parent 1e8f14c commit 1d89e55

3 files changed

Lines changed: 119 additions & 0 deletions

File tree

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "nuget" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "daily"

.github/workflows/ci.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
2+
name: CI
3+
4+
on:
5+
create:
6+
branches:
7+
- release/**
8+
push:
9+
branches:
10+
- master
11+
- dev/**
12+
paths:
13+
- MemoryModule/**
14+
- MemoryModule.Tests/**
15+
- .github/workflows/ci.yml
16+
pull_request:
17+
branches:
18+
- master
19+
paths:
20+
- MemoryModule/**
21+
- MemoryModule.Tests/**
22+
- .github/workflows/ci.yml
23+
24+
jobs:
25+
build:
26+
27+
env:
28+
BUILD_CONFIG: 'Release'
29+
SOLUTION: 'MemoryModule.sln'
30+
31+
runs-on: windows-latest
32+
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v2
36+
with:
37+
fetch-depth: 0
38+
39+
- name: Install GitVersion
40+
uses: gittools/actions/gitversion/setup@v0.9.10
41+
with:
42+
versionSpec: '5.x'
43+
44+
- name: Determine Version
45+
id: gitversion
46+
uses: gittools/actions/gitversion/execute@v0.9.10
47+
48+
- name: Setup NuGet
49+
uses: NuGet/setup-nuget@v1.0.5
50+
51+
- name: Restore dependencies
52+
run: nuget restore $SOLUTION
53+
54+
- name: Setup .NET
55+
run: |
56+
Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile 'dotnet-install.ps1'
57+
./dotnet-install.ps1 -Channel Current
58+
shell: pwsh
59+
60+
- name: Setup MSBuild
61+
uses: microsoft/setup-msbuild@v1.0.2
62+
63+
- name: Build
64+
run: msbuild $env:SOLUTION /p:Configuration=$env:BUILD_CONFIG /p:Platform="Any CPU" -p:Version=${{ steps.gitversion.outputs.assemblySemVer }}
65+
66+
- name: Run tests
67+
run: dotnet test /p:Configuration=$env:BUILD_CONFIG /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --no-restore --no-build --verbosity normal
68+
69+
- name: Build nuget packages
70+
run: msbuild -t:pack $env:SOLUTION -p:Configuration=$env:BUILD_CONFIG -p:PackageVersion=${{ steps.gitversion.outputs.semVer }}
71+
72+
- name: Move nuget packages
73+
run: mkdir .nupkgs; get-childitem *.*nupkg -recurse | foreach-object {move-item $_ -destination .nupkgs}
74+
shell: pwsh
75+
76+
- name: Publish nuget artifacts
77+
uses: actions/upload-artifact@v2
78+
with:
79+
name: packages.${{ steps.gitversion.outputs.semVer }}
80+
path: .nupkgs/**
81+
82+
- name: Publish dev
83+
if: github.ref == 'refs/heads/master'
84+
run: nuget push .nupkgs\** -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}}
85+
86+
- name: Publish
87+
if: startsWith(github.ref, 'refs/heads/release')
88+
run: nuget push .nupkgs\** -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Conventional Commits
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
- release/*
8+
9+
env:
10+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11+
12+
jobs:
13+
commitsar:
14+
name: Validate for conventional commits
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v1
19+
- name: Run commitsar
20+
uses: docker://outillage/commitsar:0.11.2

0 commit comments

Comments
 (0)