Skip to content

Commit

Permalink
Update gha for .NET
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmyers committed Jun 14, 2024
1 parent 88de020 commit ffcfc98
Showing 1 changed file with 13 additions and 47 deletions.
60 changes: 13 additions & 47 deletions .github/workflows/build-test-installer-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,59 +11,25 @@ jobs:
runs-on: windows-2019

steps:
- uses: actions/checkout@v4
- uses: microsoft/setup-msbuild@v2

# These deps never change so we cache them to speed up the GHA build. As we move to all deps in nuget, we should remove these lines
# and allow nuget to manage caching
- uses: actions/cache@v4
id: cache-nuget
- name: Checkout
uses: actions/checkout@v4
with:
path: src\packages
key: ${{ runner.os }}-nuget-${{ hashFiles('src/SolidGui/packages.config') }} # hash of one packages.config (there are others)

- name: Restore NuGet Packages
if: ${{ steps.cache-nuget.outputs.cache-hit != 'true' }}
working-directory: src
run: nuget restore
fetch-depth: '0'

- name: Inspect packages dir
shell: bash
working-directory: src/packages
run: find .

- uses: actions/cache@v4
id: cache-teamcity
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
path: lib
key: ${{ runner.os }}-teamcity-${{ hashFiles('build/getDependencies-windows.sh') }}
dotnet-version: 8.0.x
cache: true

- name: Get Dependencies from TeamCity
if: ${{ steps.cache-teamcity.outputs.cache-hit != 'true' }}
shell: bash
working-directory: build
run: ./getDependencies-windows.sh

- name: Inspect lib dir
shell: bash
working-directory: lib
run: find .

# NUnit tests are only built with debug configuration
- name: Build Solid for NUnit tests
run: msbuild /p:Configuration=Debug /p:Platform=x86 src/solid.sln
- name: Restore
run: dotnet restore src/solid.sln

- name: Install NUnit.Runner
run: nuget install NUnit.Runners -Version 2.6.4 -DirectDownload -OutputDirectory .

- name: Inspect root dir
shell: bash
run: find .
- name: Build
run: dotnet build src/solid.sln --no-restore

# tried but couldn't get NUnit tests running in GHA - cjh
# - name: Run NUnit Tests
# working-directory: output/x86/Debug
# run: ../../../NUnit.Runners.2.6.4/tools/nunit-console.exe ./SolidGui.Tests.dll
- name: Run NUnit Tests
run: dotnet test output/net461/*Tests.dll --no-build -- NUnit.TestOutputXml=TestResults

# clear output directory
# build for release ?
Expand Down

0 comments on commit ffcfc98

Please sign in to comment.