Skip to content

CI

CI #29

Workflow file for this run

name: CI
on:
push:
branches: [master, release-*]
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-*'
pull_request:
workflow_dispatch:
env:
DOTNET_NOLOGO: true
jobs:
build:
name: Build
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Fetch native binaries
# Downloads + SHA256-verifies the prebuilt native payload pinned in natives.lock.json into
# native/ (replaces the old NativeBinaries.UiPath PackageReference). pwsh ships on all runners.
shell: pwsh
run: ./fetch.natives.ps1
- name: Build
run: dotnet build LibGit2Sharp.sln --configuration Release
- name: Upload packages
uses: actions/upload-artifact@v4
with:
name: NuGet packages
path: bin/Packages/
retention-days: 7
test:
name: Test / ${{ matrix.os }} / ${{ matrix.tfm }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# Native runners, one per OS. macos-14 is Apple Silicon, so it exercises the osx-arm64
# native; windows-latest -> win-x64, ubuntu-latest -> linux-x64. The win-arm64/linux-arm64
# and osx-x64 natives ship in the package but are not runtime-tested here (would need arm
# Windows/Linux runners and a scarce Intel mac). The old dockerized multi-distro matrix was
# dropped: it pinned .NET 6/7 SDK images and included alpine/musl, which our glibc-linked
# linux natives can't run anyway.
os: [ windows-latest, ubuntu-latest, macos-14 ]
tfm: [ net8.0 ]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Fetch native binaries
shell: pwsh
run: ./fetch.natives.ps1
- name: Run ${{ matrix.tfm }} tests
# CanInspectCertificateOnClone is an upstream network-integration test that asserts GitHub's
# hardcoded SSH host-key MD5 fingerprint; it is unstable on CI (external host key, network)
# and does not exercise our native packaging, so it is excluded here.
run: dotnet test LibGit2Sharp.sln --configuration Release --framework ${{ matrix.tfm }} --logger "GitHubActions" /p:ExtraDefine=LEAKS_IDENTIFYING --filter "FullyQualifiedName!~CanInspectCertificateOnClone"