Skip to content

Publish CI test results into PR discussions, harden artifact download, and add PR preview publishing #176

Publish CI test results into PR discussions, harden artifact download, and add PR preview publishing

Publish CI test results into PR discussions, harden artifact download, and add PR preview publishing #176

Workflow file for this run

name: Build and Test
on:
push:
branches:
- master
- dev
pull_request:
branches:
- master
- dev
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
permissions: {}
jobs:
event_file:
if: github.event_name == 'pull_request'
name: Publish event file
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Upload event file
uses: actions/upload-artifact@v4
with:
name: EventFile
path: ${{ github.event_path }}
build:
permissions:
contents: read
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-latest, macOS-latest]
dotnet: [10.0.202]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Install .NET Core
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Add version to global.json
run: |
$version = "${{ matrix.dotnet }}"
$globalJsonPath = "global.json"
$globalJson = Get-Content -Raw -Path $globalJsonPath | ConvertFrom-Json
if ($null -eq $globalJson.sdk.version) {
$globalJson.sdk | Add-Member -Type NoteProperty -Name version -Value $version
} else {
$globalJson.sdk.version = $version
}
$globalJson | ConvertTo-Json -Depth 10 | Set-Content -Path $globalJsonPath
shell: pwsh
- name: Install local tools
run: dotnet tool restore
- name: Build and run integration tests
run: dotnet run --project build/Build.fsproj --launch-profile BuildAndTest
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.os }}
path: test-results