Skip to content

Commit db56de5

Browse files
authored
Merge pull request #125 from ramantsitou/ci-cd
created composite action
2 parents 353f51c + 233ab29 commit db56de5

6 files changed

Lines changed: 78 additions & 27 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: dotnet-build
2+
description: Composite .NET build action
3+
4+
inputs:
5+
dotnet-version:
6+
default: '10.0.x'
7+
required: false
8+
description: '.NET version'
9+
10+
solution:
11+
default: 'src/MockQueryable/*.sln'
12+
required: false
13+
description: 'Solution path'
14+
15+
configuration:
16+
default: 'Release'
17+
required: false
18+
description: 'Build configuration'
19+
20+
runs:
21+
using: composite
22+
steps:
23+
- name: Setup .NET
24+
uses: actions/setup-dotnet@v5
25+
with:
26+
dotnet-version: ${{ inputs.dotnet-version }}
27+
28+
- name: Restore
29+
shell: bash
30+
run: dotnet restore ${{ inputs.solution }}
31+
32+
- name: Build
33+
shell: bash
34+
run: |
35+
dotnet build ${{ inputs.solution }} \
36+
--configuration ${{ inputs.configuration }} \
37+
--no-restore

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ updates:
1313
- "/src/MockQueryable/MockQueryable.Sample"
1414
schedule:
1515
interval: "weekly"
16+
- package-ecosystem: "github-actions"
17+
directory: "/"
18+
schedule:
19+
interval: "weekly"
20+
open-pull-requests-limit: 5
21+
Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,36 @@
1-
name: .NET Core
1+
name: build
22

33
on:
44
push:
55

66
permissions:
77
contents: read
88

9+
env:
10+
DOTNET_VERSION: 10.0.x
11+
SOLUTION: src/MockQueryable/*.sln
12+
CONFIGURATION: Release
13+
914
jobs:
1015
build:
1116
runs-on: ubuntu-latest
1217

1318
steps:
1419
- uses: actions/checkout@v6
1520

16-
- name: Setup .NET
17-
uses: actions/setup-dotnet@v5
18-
with:
19-
dotnet-version: '10.0.x'
20-
21-
- name: Restore
22-
run: dotnet restore src/MockQueryable/*.sln
23-
2421
- name: Build
25-
run: dotnet build src/MockQueryable/*.sln --configuration Release --no-restore
22+
uses: ./.github/actions/dotnet-build
23+
with:
24+
dotnet-version: ${{ env.DOTNET_VERSION }}
25+
solution: ${{ env.SOLUTION }}
26+
configuration: ${{ env.CONFIGURATION }}
2627

2728
- name: Test with coverage
2829
run: |
2930
mkdir -p TestResults
3031
31-
dotnet test src/MockQueryable/*.sln \
32-
--configuration Release \
32+
dotnet test ${{ env.SOLUTION }} \
33+
--configuration ${{ env.CONFIGURATION }} \
3334
--no-build \
3435
/p:CollectCoverage=true \
3536
/p:CoverletOutput="$(pwd)/TestResults/coverage.opencover.xml" \

.github/workflows/release.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,30 @@ permissions:
1111
attestations: write
1212
artifact-metadata: write
1313

14+
env:
15+
DOTNET_VERSION: 10.0.x
16+
SOLUTION: src/MockQueryable/*.sln
17+
CONFIGURATION: Release
18+
1419
jobs:
1520
release:
1621
runs-on: ubuntu-latest
1722

1823
steps:
1924
- uses: actions/checkout@v6
2025

21-
- name: Setup .NET
22-
uses: actions/setup-dotnet@v5
23-
with:
24-
dotnet-version: '10.0.x'
25-
26-
- name: Restore
27-
run: dotnet restore src/MockQueryable/*.sln
28-
2926
- name: Build
30-
run: dotnet build src/MockQueryable/*.sln --configuration Release --no-restore
27+
uses: ./.github/actions/dotnet-build
28+
with:
29+
dotnet-version: ${{ env.DOTNET_VERSION }}
30+
solution: ${{ env.SOLUTION }}
31+
configuration: ${{ env.CONFIGURATION }}
3132

3233
- name: Pack
3334
run: |
3435
mkdir -p artifacts
35-
dotnet pack src/MockQueryable/*.sln \
36-
--configuration Release \
36+
dotnet pack ${{ env.SOLUTION }} \
37+
--configuration ${{ env.CONFIGURATION }} \
3738
--no-build \
3839
--output ./artifacts
3940
@@ -47,3 +48,5 @@ jobs:
4748
with:
4849
files: ./artifacts/*.nupkg
4950
generate_release_notes: true
51+
# prerelease if a tag contains "-"
52+
prerelease: ${{ contains(github.ref_name, '-') }}

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ Extensions for mocking [Entity Framework Core](https://github.com/dotnet/efcore)
2323
## ✅ Build & Status
2424

2525
[![codecov](https://codecov.io/github/romantitov/MockQueryable/graph/badge.svg?token=dtiYMUNHUo)](https://codecov.io/github/romantitov/MockQueryable)
26-
[![.NET Core](https://github.com/romantitov/MockQueryable/workflows/.NET%20Core/badge.svg)](https://github.com/ramantsitou/MockQueryable/actions/workflows/dotnetcore.yml)
26+
[![build](https://github.com/romantitov/MockQueryable/workflows/build/badge.svg)](https://github.com/ramantsitou/MockQueryable/actions/workflows/build.yml)
27+
[![release](https://github.com/romantitov/MockQueryable/workflows/release/badge.svg)](https://github.com/ramantsitou/MockQueryable/actions/workflows/release.yml)
2728
[![License](https://img.shields.io/github/license/romantitov/MockQueryable.svg)](https://github.com/romantitov/MockQueryable/blob/master/LICENSE)
2829

2930
---

src/MockQueryable/MockQueryable.sln

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 17
4-
VisualStudioVersion = 17.13.35931.197 d17.13
3+
# Visual Studio Version 18
4+
VisualStudioVersion = 18.6.11806.211 stable
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MockQueryable.Core", "MockQueryable.Core\MockQueryable.Core.csproj", "{7C85327C-5EE5-4C74-A1E5-9B7046CA6CFE}"
77
EndProject
@@ -17,9 +17,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MockQueryable.EntityFramewo
1717
EndProject
1818
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8EC462FD-D22E-90A8-E5CE-7E832BA40C5D}"
1919
ProjectSection(SolutionItems) = preProject
20-
..\..\.github\workflows\dotnetcore.yml = ..\..\.github\workflows\dotnetcore.yml
20+
..\..\.github\actions\dotnet-build\action.yml = ..\..\.github\actions\dotnet-build\action.yml
21+
..\..\.github\workflows\build.yml = ..\..\.github\workflows\build.yml
22+
..\..\.github\dependabot.yml = ..\..\.github\dependabot.yml
2123
..\..\LICENSE = ..\..\LICENSE
2224
..\..\README.md = ..\..\README.md
25+
..\..\.github\workflows\release.yml = ..\..\.github\workflows\release.yml
2326
EndProjectSection
2427
EndProject
2528
Global

0 commit comments

Comments
 (0)