Skip to content

Commit 473b2a4

Browse files
committed
Fix the workflows
1 parent f714e48 commit 473b2a4

4 files changed

Lines changed: 60 additions & 22 deletions

File tree

.github/WORKFLOWS.md

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@ This repository includes automated CI/CD workflows using GitHub Actions.
1010
**Steps:**
1111
- ? Checkout code
1212
- ? Setup .NET 6
13-
- ? Restore dependencies
14-
- ? Build solution
13+
- ? Restore dependencies (main project and tests)
14+
- ? Build main project
15+
- ? Build test project
1516
- ? Run all tests
1617
- ? Upload test results as artifacts
1718
- ? Generate test summary report
1819

20+
**Note:** This workflow builds only the FileWatcher and FileWatcher.Tests projects, excluding the WiX installer project to avoid build complications in CI/CD.
21+
1922
**Usage:**
2023
```bash
2124
# Runs automatically on push/PR
@@ -29,18 +32,21 @@ This repository includes automated CI/CD workflows using GitHub Actions.
2932
- ? Checkout code with full history
3033
- ? Setup .NET 6
3134
- ? Cache NuGet packages for faster builds
32-
- ? Restore dependencies
33-
- ? Build solution in Release mode
35+
- ? Restore dependencies (main project and tests)
36+
- ? Build main project in Release mode
37+
- ? Build test project in Release mode
3438
- ? Run tests with code coverage
3539
- ? Upload test results and coverage reports
3640
- ? Generate code coverage summary
3741
- ? Add coverage report as PR comment
3842
- ? Generate test report
3943
- ? Run code quality analysis (on push to main branches)
4044

45+
**Note:** This workflow builds only the FileWatcher and FileWatcher.Tests projects, excluding the WiX installer project. The installer should be built separately when creating releases.
46+
4147
**Code Coverage Thresholds:**
4248
- ?? Warning: < 60%
43-
- ? Good: 60-80%
49+
- ?? Good: 60-80%
4450
- ?? Excellent: > 80%
4551

4652
## Status Badges
@@ -76,17 +82,30 @@ Run the same tests locally:
7682

7783
```bash
7884
# Basic tests
79-
dotnet test
85+
dotnet test tests/FileWatcher.Tests.csproj
8086

8187
# With coverage
82-
dotnet test --collect:"XPlat Code Coverage"
88+
dotnet test tests/FileWatcher.Tests.csproj --collect:"XPlat Code Coverage"
8389

8490
# With detailed output
85-
dotnet test --verbosity detailed
91+
dotnet test tests/FileWatcher.Tests.csproj --verbosity detailed
8692

8793
# Build in Release mode (like CI)
88-
dotnet build --configuration Release
89-
dotnet test --configuration Release --no-build
94+
dotnet build src/FileWatcher.csproj --configuration Release
95+
dotnet build tests/FileWatcher.Tests.csproj --configuration Release
96+
dotnet test tests/FileWatcher.Tests.csproj --configuration Release --no-build
97+
```
98+
99+
## Building the Full Solution
100+
101+
To build the complete solution including the WiX installer:
102+
103+
```bash
104+
# Build the entire solution (including WiX installer)
105+
dotnet build FileWatcher.sln --configuration Release
106+
107+
# Note: WiX installer requires WiX Toolset to be installed
108+
# Download from: https://wixtoolset.org/
90109
```
91110

92111
## Artifacts
@@ -115,6 +134,11 @@ Download from the workflow run page in GitHub Actions.
115134
- Verify branch names match in `on:` section
116135
- Ensure YAML syntax is valid
117136

137+
### WiX Installer Build Issues?
138+
- The CI/CD workflows intentionally exclude the WiX installer project
139+
- WiX builds require special setup and are typically done during release creation
140+
- To build the installer locally, ensure WiX Toolset 4.0+ is installed
141+
118142
## Future Enhancements
119143

120144
Potential additions to the CI/CD pipeline:
@@ -125,3 +149,4 @@ Potential additions to the CI/CD pipeline:
125149
- [ ] Performance benchmarking
126150
- [ ] Security vulnerability scanning
127151
- [ ] Docker image building and publishing
152+
- [ ] Separate workflow for building WiX installer on releases

.github/workflows/ci-cd.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88

99
env:
1010
DOTNET_VERSION: '6.0.x'
11-
SOLUTION_PATH: './FileWatcher.sln'
1211

1312
jobs:
1413
build-and-test:
@@ -35,13 +34,17 @@ jobs:
3534
${{ runner.os }}-nuget-
3635
3736
- name: Restore dependencies
38-
run: dotnet restore
37+
run: |
38+
dotnet restore src/FileWatcher.csproj
39+
dotnet restore tests/FileWatcher.Tests.csproj
3940
4041
- name: Build
41-
run: dotnet build --no-restore --configuration Release
42+
run: |
43+
dotnet build src/FileWatcher.csproj --no-restore --configuration Release
44+
dotnet build tests/FileWatcher.Tests.csproj --no-restore --configuration Release
4245
4346
- name: Run Tests with Coverage
44-
run: dotnet test --no-build --configuration Release --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage --logger "trx;LogFileName=test-results.trx"
47+
run: dotnet test tests/FileWatcher.Tests.csproj --no-build --configuration Release --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage --logger "trx;LogFileName=test-results.trx"
4548

4649
- name: Upload test results
4750
if: always()
@@ -107,11 +110,15 @@ jobs:
107110
dotnet-version: ${{ env.DOTNET_VERSION }}
108111

109112
- name: Restore dependencies
110-
run: dotnet restore
113+
run: |
114+
dotnet restore src/FileWatcher.csproj
115+
dotnet restore tests/FileWatcher.Tests.csproj
111116
112117
- name: Build
113-
run: dotnet build --no-restore --configuration Release
118+
run: |
119+
dotnet build src/FileWatcher.csproj --no-restore --configuration Release
120+
dotnet build tests/FileWatcher.Tests.csproj --no-restore --configuration Release
114121
115122
- name: Run Code Analysis
116-
run: dotnet format --verify-no-changes --verbosity diagnostic
123+
run: dotnet format src/FileWatcher.csproj --verify-no-changes --verbosity diagnostic
117124
continue-on-error: true

.github/workflows/tests.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,19 @@ jobs:
2121
dotnet-version: '6.0.x'
2222

2323
- name: Restore dependencies
24-
run: dotnet restore
24+
run: dotnet restore src/FileWatcher.csproj
25+
26+
- name: Restore test dependencies
27+
run: dotnet restore tests/FileWatcher.Tests.csproj
2528

2629
- name: Build
27-
run: dotnet build --no-restore --configuration Release
30+
run: dotnet build src/FileWatcher.csproj --no-restore --configuration Release
31+
32+
- name: Build Tests
33+
run: dotnet build tests/FileWatcher.Tests.csproj --no-restore --configuration Release
2834

2935
- name: Test
30-
run: dotnet test --no-build --configuration Release --verbosity normal --logger "trx;LogFileName=test-results.trx"
36+
run: dotnet test tests/FileWatcher.Tests.csproj --no-build --configuration Release --verbosity normal --logger "trx;LogFileName=test-results.trx"
3137

3238
- name: Upload test results
3339
if: always()

FwInstaller/FwInstaller.wixproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<Project Sdk="WixToolset.Sdk/4.0.0">
22
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
3-
<OutputPath>..\FileWatcher\bin\Release\net6.0\publish\win-x64</OutputPath>
3+
<OutputPath>..\src\bin\Release\net6.0\publish\win-x64</OutputPath>
44
</PropertyGroup>
55
<ItemGroup>
66
<None Include="config.xml.sample" />
77
</ItemGroup>
88
<ItemGroup>
9-
<ProjectReference Include="..\FileWatcher\FileWatcher.csproj" />
9+
<ProjectReference Include="..\src\FileWatcher.csproj" />
1010
</ItemGroup>
1111
</Project>

0 commit comments

Comments
 (0)