forked from libgit2/libgit2sharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revise workflows to better integrate them
- Loading branch information
Showing
1 changed file
with
53 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- name: Install .NET SDK | ||
uses: actions/[email protected] | ||
with: | ||
dotnet-version: 6.0.x | ||
- name: Build | ||
run: dotnet build LibGit2Sharp.sln --configuration Release | ||
- name: Upload packages | ||
uses: actions/[email protected] | ||
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,64 +52,54 @@ jobs: | |
with: | ||
dotnet-version: 6.0.x | ||
- name: Install .NET 5 runtime | ||
if: matrix.tfm == 'net5.0' | ||
uses: actions/[email protected] | ||
with: | ||
dotnet-version: 5.0.x | ||
- name: Install .NET Core 3.1 runtime | ||
if: matrix.tfm == 'netcoreapp3.1' | ||
uses: actions/[email protected] | ||
with: | ||
dotnet-version: 3.1.x | ||
- name: Build | ||
run: dotnet build LibGit2Sharp.sln --configuration Release | ||
- name: Upload packages | ||
if: matrix.name == 'Windows' | ||
uses: actions/[email protected] | ||
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 | ||
native_test: | ||
name: Test on [${{ matrix.arch }}] net${{ matrix.sdk }} SDK - ${{ matrix.distro }} | ||
- 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 ] | ||
sdk: [ '6.0', '5.0', '3.1' ] | ||
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 | ||
- 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/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup QEMU | ||
if: matrix.arch == 'arm64' | ||
run: docker run --rm --privileged multiarch/qemu-user-static:register --reset | ||
|
||
- name: Test with docker | ||
- name: Run ${{ matrix.tfm }} tests | ||
run: | | ||
[[ ${{ matrix.sdk }} = '3.1' ]] && target="netcoreapp${{ matrix.sdk }}" || target="net${{ matrix.sdk }}" | ||
test_command="dotnet test LibGit2Sharp.sln --configuration Release -p:TargetFrameworks=$target -p:ExtraDefine=LEAKS_IDENTIFYING -p:GeneratePackageOnBuild=false" | ||
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" |