Skip to content

Main alignment

Main alignment #302

Workflow file for this run

name: CI Test
on:
push:
branches:
- "main"
- "release/*"
pull_request:
# any
merge_group:
types: [checks_requested]
jobs:
Test:
strategy:
fail-fast: false
matrix:
# as of writing (10th July 2022) there are only x86_64 machines
include:
# windows version independent RIDs.
# testing version-specific RIDs seems unreasonable given no clear & obvious mapping
# between datacenter versions and home versions
- rid: win-x64
os: windows-latest
name: win-x64
- rid: win-x86
os: windows-latest
name: win-x86
# given there appear to be significant differences
# we test all available ubuntu versions here
# if this causes significant slow downs, remove
# no clangsharp support https://github.com/dotnet/ClangSharp/issues/364
# - rid: linux-x64
# os: ubuntu-22.04
- rid: ubuntu.20.04-x64
os: ubuntu-20.04
name: ubuntu-20.04-x64
# Ubuntu raises an SEH exception, see https://discord.com/channels/521092042781229087/1004867182787838043/1004887853500739684
# - rid: ubuntu.18.04-x64
# os: ubuntu-18.04
# macos 10.15 is not tested as the runner image is deprecated.
# view https://github.com/actions/virtual-environments/blob/main/images/macos/ files for info on xcode sdk versions
- rid: osx.12-x64
os: macos-12
xcode_sdk: macosx12.3 # macos-12 image is currently (5th August 2022) on MacOS 12.5 but the latest sdk is macosx12.3
xcode_version: Xcode_13.4.1
name: macosx12.3-xcode13
- rid: osx.11.0-x64
os: macos-11
xcode_sdk: macosx11.3
xcode_version: Xcode_12.5.1
name: macosx11.3-xcode12
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: "true"
- name: Setup .NET
uses: actions/setup-dotnet@v2
- name: Restore
run: dotnet restore --runtime ${{ matrix.rid }}
# Build can't be done in a separate step as building for a specific runtime & configuration is unsupported for some reason...
# https://github.com/dotnet/sdk/issues/14281
# doing the same (building for a specific configuration and runtime is supported via dotnet test)
- name: Switch XCode Version
if: matrix.xcode_version != 0
run: sudo xcode-select -switch /Applications/${{ matrix.xcode_version }}.app
- name: Test
run: dotnet test -c Release --no-restore --runtime ${{ matrix.rid }} --collect:"XPlat Code Coverage" --results-directory ./coverage
env:
SILK_DOTNET_Scraper__XcodeSdk: ${{ matrix.xcode_sdk }}
- name: Upload Coverage Results
uses: actions/upload-artifact@v3
with:
name: coverage-${{ matrix.name }}
path: ./coverage/**/coverage.cobertura.xml
Report_Coverage:
runs-on: ubuntu-latest
needs: Test
permissions:
pull-requests: write
steps:
- uses: actions/download-artifact@v3
with:
path: ./coverage
- name: Setup .NET Core # Required to execute ReportGenerator
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.300
- name: ReportGenerator
uses: danielpalme/[email protected]
with:
reports: './coverage/**/**/coverage.cobertura.xml'
targetdir: './coveragereport'
reporttypes: 'Cobertura'
# historydir: '' # Optional directory for storing persistent coverage information. Can be used in future reports to show coverage evolution.
# plugins: '' # Optional plugin files for custom reports or custom history storage (separated by semicolon).
verbosity: 'Info' # The verbosity level of the log messages. Values: Verbose, Info, Warning, Error, Off
tag: '${{ github.run_number }}_${{ github.run_id }}' # Optional tag or build version.
- name: Generate Summary
uses: irongut/[email protected]
with:
filename: './coveragereport/Cobertura.xml'
badge: true
fail_below_min: true
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: file
thresholds: '30 70'
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: always() && github.event_name == 'pull_request'
with:
header: coverage-results
path: code-coverage-results.md