未验证 提交 4daf6189 编写于 作者: B Brandon Ording 提交者: GitHub

Merge pull request #1921 from arturcic/feature/test-native

Test native libraries using docker for multiple distros
......@@ -11,17 +11,36 @@ env:
DOTNET_NOLOGO: true
jobs:
build:
name: ${{ matrix.name }}
name: Build
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
with:
fetch-depth: 0
- name: Install .NET SDK
uses: actions/setup-dotnet@v1.8.1
with:
dotnet-version: 6.0.x
- name: Build
run: dotnet build LibGit2Sharp.sln --configuration Release
- name: Upload packages
uses: actions/upload-artifact@v2.2.4
with:
name: NuGet packages
path: bin/Packages/
retention-days: 7
test:
name: Test / ${{ matrix.os }} / ${{ matrix.arch }} / ${{ matrix.tfm }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-2019
name: Windows
- os: ubuntu-20.04
name: Linux
arch: [ amd64 ]
os: [windows-2019, macos-10.15]
tfm: [ net472, netcoreapp3.1, net5.0, net6.0 ]
exclude:
- os: macos-10.15
name: macOS
tfm: net472
fail-fast: false
steps:
- name: Checkout
......@@ -33,28 +52,54 @@ jobs:
with:
dotnet-version: 6.0.x
- name: Install .NET 5 runtime
if: matrix.tfm == 'net5.0'
uses: actions/setup-dotnet@v1.8.1
with:
dotnet-version: 5.0.x
- name: Install .NET Core 3.1 runtime
if: matrix.tfm == 'netcoreapp3.1'
uses: actions/setup-dotnet@v1.8.1
with:
dotnet-version: 3.1.x
- name: Build
run: dotnet build LibGit2Sharp.sln --configuration Release
- name: Upload packages
if: matrix.name == 'Windows'
uses: actions/upload-artifact@v2.2.4
- name: Run ${{ matrix.tfm }} tests
run: dotnet test LibGit2Sharp.sln --configuration Release --framework ${{ matrix.tfm }} --logger "GitHubActions" /p:ExtraDefine=LEAKS_IDENTIFYING
test-linux:
name: Test / ${{ matrix.distro }} / ${{ matrix.arch }} / ${{ matrix.tfm }}
runs-on: ubuntu-20.04
strategy:
matrix:
arch: [ amd64 ]
# arch: [ amd64, arm64 ]
distro: [ alpine.3.12, alpine.3.13, alpine.3.14, centos.7, centos.8, debian.9, debian.10, debian.11, fedora.33, ubuntu.18.04, ubuntu.20.04 ]
sdk: [ '6.0', '5.0', '3.1' ]
exclude:
- arch: arm64
distro: alpine.3.12
- arch: arm64
distro: alpine.3.13
sdk: '3.1'
- arch: arm64
distro: alpine.3.14
sdk: '3.1'
- arch: arm64
distro: centos.7
include:
- sdk: '6.0'
tfm: net6.0
- sdk: '5.0'
tfm: net5.0
- sdk: '3.1'
tfm: netcoreapp3.1
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
with:
name: NuGet packages
path: bin/Packages/
retention-days: 7
- name: Run net472 tests
if: matrix.name == 'Windows'
run: dotnet test LibGit2Sharp.sln --configuration Release --no-restore --framework net472 --logger "GitHubActions" /p:ExtraDefine=LEAKS_IDENTIFYING
- name: Run netcoreapp3.1 tests
run: dotnet test LibGit2Sharp.sln --configuration Release --no-restore --framework netcoreapp3.1 --logger "GitHubActions" /p:ExtraDefine=LEAKS_IDENTIFYING
- name: Run net5.0 tests
run: dotnet test LibGit2Sharp.sln --configuration Release --no-restore --framework net5.0 --logger "GitHubActions" /p:ExtraDefine=LEAKS_IDENTIFYING
- name: Run net6.0 tests
run: dotnet test LibGit2Sharp.sln --configuration Release --no-restore --framework net6.0 --logger "GitHubActions" /p:ExtraDefine=LEAKS_IDENTIFYING
fetch-depth: 0
- name: Setup QEMU
if: matrix.arch == 'arm64'
run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
- name: Run ${{ matrix.tfm }} tests
run: |
test_command="dotnet test LibGit2Sharp.sln --configuration Release -p:TargetFrameworks=${{ matrix.tfm }} --logger "GitHubActions" -p:ExtraDefine=LEAKS_IDENTIFYING"
docker run -t --rm --platform linux/${{ matrix.arch }} -v "$PWD:/app" gittools/build-images:${{ matrix.distro }}-sdk-${{ matrix.sdk }} sh -c "$test_command"
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net472;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks Condition="'$(TargetFrameworks)'==''">net472;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册