diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d1d66f5fdc59c827b70868b0f0f4fcc51f9231d..1f7351f3938673eca3ac8f05f056783b22f1ec29 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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" diff --git a/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj b/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj index 771b75696ca11c97cd9779cd374b6813b3944328..6ddcfbd055d971d3e1a3a2f584f0401d4246050f 100644 --- a/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj +++ b/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj @@ -1,7 +1,7 @@  - net472;netcoreapp3.1;net5.0;net6.0 + net472;netcoreapp3.1;net5.0;net6.0