Skip to content

Fix dotnet builds on MacOS on arm processor #236

Fix dotnet builds on MacOS on arm processor

Fix dotnet builds on MacOS on arm processor #236

Workflow file for this run

name: Build and run tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
net:
name: .NET
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-13, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
3.1.x
8.0.x
- name: Restore
working-directory: ${{ github.workspace }}/net
run: dotnet restore
- name: Build and run tests
working-directory: ${{ github.workspace }}/net
run: dotnet test --configuration Release --no-restore --verbosity normal --logger 'trx;LogFilePrefix=test-results'
- name: Upload test results
uses: actions/upload-artifact@v3
if: always()
with:
name: net-test-results-${{ matrix.os }}
path: ${{ github.workspace }}/net/**/tests/TestResults/*
if-no-files-found: error
net-macos-arm64:
name: .NET MACOS ARM64
strategy:
fail-fast: false
matrix:
os: [ macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
3.1.x
8.0.x
- name: Manually setup .NET 8.0 x64 SDK
run: wget https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh && chmod +x dotnet-install.sh && ./dotnet-install.sh --architecture x64 --skip-non-versioned-files --channel 8.0
- name: Restore
working-directory: ${{ github.workspace }}/net
run: dotnet restore
- name: Build and run tests
working-directory: ${{ github.workspace }}/net
run: dotnet test --configuration Release --no-restore --verbosity normal --logger 'trx;LogFilePrefix=test-results'
- name: Upload test results
uses: actions/upload-artifact@v3
if: always()
with:
name: net-test-results-${{ matrix.os }}
path: ${{ github.workspace }}/net/**/tests/TestResults/*
if-no-files-found: error
net-qemu:
name: .NET QEMU
strategy:
fail-fast: false
matrix:
arch: [ s390x ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install QEMU static executables formats
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Setup .NET SDK, Restore, Build and Tests under QEMU ${{ matrix.arch }}
run: >
docker run --rm -v "${{ github.workspace }}:/work" --platform linux/${{ matrix.arch }} ${{ matrix.arch }}/fedora:39 /bin/bash -c " \
dnf install -y dotnet-sdk-8.0 && \
cd /work/net && \
dotnet restore && \
dotnet test -f net8.0 --configuration Release --no-restore --verbosity normal --logger 'trx;LogFilePrefix=test-results' && \
true"
- name: Upload test results
uses: actions/upload-artifact@v3
if: always()
with:
name: net-test-results-qemu-${{ matrix.arch }}
path: ${{ github.workspace }}/net/**/tests/TestResults/*
if-no-files-found: error
net-self-hosted:
name: .NET SelfHosted
strategy:
fail-fast: false
matrix:
include:
- os: linux
arch: s390x
- os: freebsd
arch: amd64
- os: freebsd
arch: arm64
runs-on:
- self-hosted
- ${{ matrix.os }}
- ${{ matrix.arch }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore
working-directory: ${{ github.workspace }}/net
run: dotnet restore
- name: Build and Tests
working-directory: ${{ github.workspace }}/net
run: dotnet test -f net8.0 --configuration Release --no-restore --verbosity normal --logger 'trx;LogFilePrefix=test-results'
- name: Upload test results
uses: actions/upload-artifact@v3
if: always()
with:
name: net-test-results-self-hosted-${{ matrix.os }}-${{ matrix.arch }}
path: ${{ github.workspace }}/net/**/tests/TestResults/*
if-no-files-found: error
jvm:
name: JVM
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v2
- name: Gradle Build
uses: gradle/gradle-build-action@v2
with:
arguments: test --stacktrace
build-root-directory: ${{ github.workspace }}/jvm
- name: Upload test results
uses: actions/upload-artifact@v3
if: always()
with:
name: jvm-test-results-${{ matrix.os }}
path: ${{ github.workspace }}/jvm/build/test-results/test/*
if-no-files-found: error
jvm-qemu:
name: JVM QEMU
strategy:
fail-fast: false
matrix:
arch: [ s390x, ppc64le ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install QEMU static executables formats
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Setup JDK and Tests under QEMU ${{ matrix.arch }}
run: >
docker run --rm -e JAVA_OPTS="-Djdk.lang.Process.launchMechanism=vfork" -v ${PWD}:/home/gradle/project -w /home/gradle/project/jvm --platform linux/${{ matrix.arch }} gradle:jdk17 gradle test --stacktrace
- name: Upload test results
uses: actions/upload-artifact@v3
if: always()
with:
name: jvm-test-results-qemu-${{ matrix.arch }}
path: ${{ github.workspace }}/jvm/build/test-results/test/*
if-no-files-found: error
jvm-self-hosted:
name: JVM SelfHosted
strategy:
fail-fast: false
matrix:
include:
- os: linux
arch: s390x
- os: linux
arch: ppc64le
- os: freebsd
arch: amd64
- os: freebsd
arch: arm64
runs-on:
- self-hosted
- ${{ matrix.os }}
- ${{ matrix.arch }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v2
- name: Gradle Build
uses: gradle/gradle-build-action@v2
with:
arguments: test --stacktrace
build-root-directory: ${{ github.workspace }}/jvm
- name: Upload test results
uses: actions/upload-artifact@v3
if: always()
with:
name: jvm-test-results-self-hosted-${{ matrix.os }}-${{ matrix.arch }}
path: ${{ github.workspace }}/jvm/build/test-results/test/*
if-no-files-found: error