Skip to content

Commit

Permalink
introduce sln filter file to make sure we only compile lexbox project…
Browse files Browse the repository at this point in the history
…s in CI and not FW Lite projects.
  • Loading branch information
hahn-kev committed Jul 31, 2024
1 parent 49c6a12 commit c15d406
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/integration-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,10 @@ jobs:
run: |
sudo ln -s ${{ steps.python.outputs.python-path }} /usr/bin/python2
- name: Dotnet build
working-directory: backend/LexBoxApi
# limit cpu count for self-hosted due to memory constraints
run: dotnet build ${{ inputs.runs-on == 'self-hosted' && '-maxcpucount:2' || '' }}
run: dotnet build LexBoxOnly.slnf ${{ inputs.runs-on == 'self-hosted' && '-maxcpucount:2' || '' }}
- name: Build for tests
working-directory: backend/Testing
run: "dotnet build /p:MercurialVersion=$MERCURIAL_VERSION"
run: "dotnet build LexBoxOnly.slnf /p:MercurialVersion=$MERCURIAL_VERSION"
env:
MERCURIAL_VERSION: ${{ inputs.hg-version }}

Expand All @@ -122,7 +120,7 @@ jobs:
# the self hosted runner only has 2gb so this should prevent it from running out of memory
DOTNET_GCHeapHardLimit: '0x2CB417800'

run: dotnet test --output ./bin --logger trx --results-directory ./test-results --filter Category=Integration
run: dotnet test LexBoxOnly.slnf --output ./bin --logger trx --results-directory ./test-results --filter Category=Integration
- name: Publish unit test results
uses: EnricoMi/publish-unit-test-result-action/composite@8885e273a4343cd7b48eaa72428dea0c3067ea98 # v2.14.0
if: ${{ always() && !env.act }}
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/lexbox-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,15 @@ jobs:
with:
dotnet-version: '8.x'
- name: Dotnet build
working-directory: backend/LexBoxApi
run: dotnet build
run: dotnet build LexBoxOnly.slnf
- name: Unit tests
working-directory: backend/Testing
run: dotnet test --logger:"xunit;LogFileName={assembly}.results.xml" --results-directory ./test-results --filter "Category!=Integration" --blame-hang-timeout 10m
run: dotnet test LexBoxOnly.slnf --logger:"xunit;LogFileName={assembly}.results.xml" --results-directory ./test-results --filter "Category!=Integration" --blame-hang-timeout 10m
- name: Publish unit test results
uses: EnricoMi/publish-unit-test-result-action@8885e273a4343cd7b48eaa72428dea0c3067ea98 # v2.14.0
if: always()
with:
check_name: C# Unit Tests
files: ./backend/Testing/test-results/*.xml
files: ./test-results/*.xml
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
Expand Down
17 changes: 17 additions & 0 deletions LexBoxOnly.slnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"solution": {
"path": "LexBox.sln",
"projects": [
"backend\\FixFwData\\FixFwData.csproj",
"backend\\FwLite\\MiniLcm\\MiniLcm.csproj",
"backend\\LexBoxApi\\LexBoxApi.csproj",
"backend\\LexCore\\LexCore.csproj",
"backend\\LexData\\LexData.csproj",
"backend\\LfClassicData\\LfClassicData.csproj",
"backend\\SyncReverseProxy\\SyncReverseProxy.csproj",
"backend\\Testing\\Testing.csproj",
"backend\\harmony\\src\\SIL.Harmony.Core\\SIL.Harmony.Core.csproj",
"backend\\harmony\\src\\SIL.Harmony\\SIL.Harmony.csproj"
]
}
}

0 comments on commit c15d406

Please sign in to comment.