Skip to content

Commit

Permalink
Enabling unit tests for macOS (#82)
Browse files Browse the repository at this point in the history
* Enabling unit tests for macOS

* Add hostname to /etc/hosts
  • Loading branch information
paveliak authored Apr 15, 2024
1 parent 74a4f71 commit 9a15d1f
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/main-ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: windows-latest
windows: true
Expand Down Expand Up @@ -64,10 +64,10 @@ jobs:
if: matrix.os == 'windows-latest'
- name: Build for macOS-x64
run: dotnet msbuild /t:Package /p:WindowsOnly=false /p:RuntimeIdentifier=osx-x64 /p:Configuration=Release /p:TargetFramework=net8.0 /p:VersionSuffix=rel
if: matrix.os == 'ubuntu-latest'
if: matrix.os == 'macos-latest'
- name: Build for macOS-arm64
run: dotnet msbuild /t:Package /p:WindowsOnly=false /p:RuntimeIdentifier=osx-arm64 /p:Configuration=Release /p:TargetFramework=net8.0 /p:VersionSuffix=rel
if: matrix.os == 'ubuntu-latest'
if: matrix.os == 'macos-latest'
- name: Build for Linux-x64
run: dotnet msbuild /t:Package /p:WindowsOnly=false /p:RuntimeIdentifier=linux-x64 /p:Configuration=Release /p:TargetFramework=net8.0 /p:VersionSuffix=rel
if: matrix.os == 'ubuntu-latest'
Expand All @@ -85,6 +85,15 @@ jobs:
AZBRIDGE_TEST_CXNSTRING: ${{ secrets.AZBRIDGE_TEST_CXNSTRING }}
run: dotnet test /p:TargetFramework=net8.0 /p:RuntimeIdentifier=linux-x64 /p:Configuration=Debug
if: matrix.os == 'ubuntu-latest'
- name: Unit Test macOS x64
env:
AZBRIDGE_TEST_CXNSTRING: ${{ secrets.AZBRIDGE_TEST_CXNSTRING }}
# W/A for Dns.GetHostEntry(Dns.GetHostName()) exception https://github.com/actions/runner-images/issues/8649
run: |
echo -e "$(ipconfig getifaddr en0) $(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts
./test/unit/macos_unblock_testip.sh
dotnet test /p:TargetFramework=net8.0 /p:RuntimeIdentifier=osx-x64 /p:Configuration=Debug
if: matrix.os == 'macos-latest'

- uses: actions/upload-artifact@v2
with:
Expand Down

0 comments on commit 9a15d1f

Please sign in to comment.