Skip to content

Commit 756d8bc

Browse files
authored
Merge pull request #15 from SeifMohmmed/feature/application-layer-cqrs
Add GitHub Actions workflow for .NET build and test
2 parents 9164230 + 075ff38 commit 756d8bc

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Build
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- master
7+
env:
8+
DOTNET_VERSION: "9.x"
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
defaults:
13+
run:
14+
working-directory: src
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Setup .NET
19+
uses: actions/setup-dotnet@v4
20+
with:
21+
dotnet-version: ${{ env.DOTNET_VERSION }}
22+
23+
- name: Restore
24+
run: dotnet restore CodeClash.sln
25+
26+
- name: Build
27+
run: >
28+
dotnet build CodeClash.sln
29+
--configuration Release
30+
--no-restore
31+
-p:TreatWarningsAsErrors=true
32+
-p:EnforceCodeStyleInBuild=true
33+
34+
- name: Test
35+
run: >
36+
dotnet test CodeClash.sln
37+
--configuration Release
38+
--no-restore
39+
--no-build
40+
--verbosity normal
41+
--logger "trx;LogFileName=test-results.trx"
42+
43+
- name: Upload Test Results
44+
if: always()
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: test-results
48+
path: src/**/TestResults/*.trx
49+
50+
- name: Publish
51+
run: >
52+
dotnet publish CodeClash.sln
53+
--configuration Release
54+
--no-restore
55+
--no-build
56+
--output ./publish

0 commit comments

Comments
 (0)