Skip to content

BL-15436 another fix for chinese name handling #739

BL-15436 another fix for chinese name handling

BL-15436 another fix for chinese name handling #739

Workflow file for this run

name: build-test
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
build:
timeout-minutes: 60
permissions:
contents: read
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
framework: [net462, net48, net8.0, net8.0-windows]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.framework }}
cancel-in-progress: true
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Build project
run: dotnet build -bl:build.binlog -c Release
- name: Get Path to Tests
run: echo "TEST_PATH=$(dotnet msbuild SIL.Core.Tests/ --getProperty:OutputPath -p:TargetFramework=${{ matrix.framework }} -p:Configuration=Release)" >> $GITHUB_ENV
# Several steps to set up FFmpeg and Scream and start Audio Service so that audio tests can run
- name: Install FFmpeg
uses: FedericoCarboni/setup-ffmpeg@v3
id: setup-ffmpeg
with:
ffmpeg-version: release
- run: echo ffmpeg path ${{ steps.setup-ffmpeg.outputs.ffmpeg-path }}
- name: Verify FFmpeg Installation
run: |
echo $PATH
ffmpeg -version
- name: Install Scream
shell: powershell
run: |
Invoke-WebRequest https://github.com/duncanthrax/scream/releases/download/4.0/Scream4.0.zip -OutFile Scream4.0.zip
Expand-Archive -Path Scream4.0.zip -DestinationPath Scream
openssl req -batch -verbose -x509 -newkey rsa -keyout ScreamCertificate.pvk -out ScreamCertificate.cer -nodes -extensions v3_req
openssl pkcs12 -export -nodes -in ScreamCertificate.cer -inkey ScreamCertificate.pvk -out ScreamCertificate.pfx -passout pass:
- name: Setup MSVC Dev Cmd
uses: ilammy/msvc-dev-cmd@v1
- name: Sign and Install Scream Driver - allows unit tests that require an audio output device
shell: powershell
run: |
signtool sign /v /fd SHA256 /f ScreamCertificate.pfx Scream\Install\driver\x64\Scream.cat
Import-Certificate -FilePath ScreamCertificate.cer -CertStoreLocation Cert:\LocalMachine\root
Import-Certificate -FilePath ScreamCertificate.cer -CertStoreLocation Cert:\LocalMachine\TrustedPublisher
Scream\Install\helpers\devcon-x64.exe install Scream\Install\driver\x64\Scream.inf *Scream
timeout-minutes: 5
- name: Start Windows Audio Service
shell: powershell
run: |
$svc = Get-Service -Name "audiosrv"
if ($svc.Status -ne "Running") {
net start audiosrv
}
# there are cases where this will fail and we want to know about it
# so we don't use continue-on-error, but we still want to publish the results
- name: Test project
id: test
run: dotnet test "$TEST_PATH"/SIL*Tests.dll --filter "(TestCategory != SkipOnTeamCity) & (TestCategory != RequiresAudioInputDevice)" --blame-hang-timeout 5m --logger:"trx;LogFilePrefix=results" --results-directory ./test-results
- name: Upload hang dump (if any)
if: always()
uses: actions/upload-artifact@v4
with:
name: Hang dumps (${{ matrix.framework }})
path: |
**/testhost_*.dmp
**/sequence.xml
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: Test results (${{ matrix.framework }})
path: ./test-results
# Limit the packaging to a single matrix job
# The dotnet build above does not specify the framework, so all artifacts are available on each job for packaging
- name: Nuget Packaging
id: nuget
run: dotnet pack --include-symbols --no-restore --no-build -p:SymbolPackageFormat=snupkg --property:Platform="Any CPU" --output ./artifacts
if: matrix.framework == 'net8.0-windows'
# You might want to test out the PR packages, but the release should be pulled from nuget
- name: Upload Nuget Packages
id: nuget-temp
uses: actions/upload-artifact@v4
with:
name: Nuget Packages
path: |
./artifacts/*.nupkg
./artifacts/*.snupkg
if: github.event_name == 'pull_request' && matrix.framework == 'net8.0-windows'
# When refreshing the Nuget publishing token, make sure it covers all the libpalaso packages
- name: Publish Nuget Packages
id: nuget-publish
run: dotnet nuget push artifacts/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.SILLSDEV_PUBLISH_NUGET_ORG}} --skip-duplicate
if: (github.ref_name == 'master' || startsWith(github.ref, 'refs/tags/v')) && matrix.framework == 'net8.0-windows'
- name: Publish logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: binary-logs (${{ matrix.framework }})
path: build.binlog
publish-test-results:
permissions:
checks: write
contents: read
pull-requests: write
runs-on: ubuntu-latest
needs: build
if: always()
steps:
- name: Download test results
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: Test results *
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@8885e273a4343cd7b48eaa72428dea0c3067ea98 # v2.14.0
with:
check_name: Palaso Tests
files: artifacts/**/*.trx
action_fail: true
action_fail_on_inconclusive: true