From cb87b57bddcdbc09df975a517d674e217505ec7e Mon Sep 17 00:00:00 2001 From: Marko Lahma Date: Sun, 23 Jul 2023 18:07:03 +0300 Subject: [PATCH] Fix Linux font installation with proper NotoColorEmoji-Regular.ttf * remove package caching * fix test case to be windows dependent --- .github/workflows/CI.yml | 14 -------------- .github/workflows/PR.yml | 14 -------------- build/Build.GitHubAction.cs | 7 +++++-- build/Build.cs | 10 +++++----- .../XSSF/Streaming/TestAutoSizeColumnTracker.cs | 1 + 5 files changed, 11 insertions(+), 35 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 6a6a7b4ca..bc4467de0 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -29,13 +29,6 @@ jobs: timeout-minutes: 20 steps: - uses: actions/checkout@v3 - - name: 'Cache: .nuke/temp, ~/.nuget/packages' - uses: actions/cache@v3 - with: - path: | - .nuke/temp - ~/.nuget/packages - key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }} - name: 'Run: Clean, Test, Pack' run: ./build.cmd Clean Test Pack - name: 'Publish: artifacts' @@ -49,13 +42,6 @@ jobs: timeout-minutes: 20 steps: - uses: actions/checkout@v3 - - name: 'Cache: .nuke/temp, ~/.nuget/packages' - uses: actions/cache@v3 - with: - path: | - .nuke/temp - ~/.nuget/packages - key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }} - name: 'Run: Clean, Test, Pack' run: ./build.cmd Clean Test Pack - name: 'Publish: artifacts' diff --git a/.github/workflows/PR.yml b/.github/workflows/PR.yml index 197eaf8df..66b1df03b 100644 --- a/.github/workflows/PR.yml +++ b/.github/workflows/PR.yml @@ -25,13 +25,6 @@ jobs: timeout-minutes: 20 steps: - uses: actions/checkout@v3 - - name: 'Cache: .nuke/temp, ~/.nuget/packages' - uses: actions/cache@v3 - with: - path: | - .nuke/temp - ~/.nuget/packages - key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }} - name: 'Run: Clean, Test, Pack' run: ./build.cmd Clean Test Pack - name: 'Publish: artifacts' @@ -45,13 +38,6 @@ jobs: timeout-minutes: 20 steps: - uses: actions/checkout@v3 - - name: 'Cache: .nuke/temp, ~/.nuget/packages' - uses: actions/cache@v3 - with: - path: | - .nuke/temp - ~/.nuget/packages - key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }} - name: 'Run: Clean, Test, Pack' run: ./build.cmd Clean Test Pack - name: 'Publish: artifacts' diff --git a/build/Build.GitHubAction.cs b/build/Build.GitHubAction.cs index 46e494e73..9f6a04398 100644 --- a/build/Build.GitHubAction.cs +++ b/build/Build.GitHubAction.cs @@ -1,3 +1,4 @@ +using System; using Nuke.Common.CI.GitHubActions; [GitHubActions("CI", @@ -5,14 +6,16 @@ GitHubActionsImage.UbuntuLatest, OnPushBranches = new[] { "main", "master" }, InvokedTargets = new[] { nameof(Clean), nameof(Test), nameof(Pack) }, - TimeoutMinutes = 20 + TimeoutMinutes = 20, + CacheKeyFiles = new string[0] )] [GitHubActions("PR", GitHubActionsImage.WindowsLatest, GitHubActionsImage.UbuntuLatest, On = new [] { GitHubActionsTrigger.PullRequest }, InvokedTargets = new[] { nameof(Clean), nameof(Test), nameof(Pack) }, - TimeoutMinutes = 20 + TimeoutMinutes = 20, + CacheKeyFiles = new string[0] )] partial class Build { diff --git a/build/Build.cs b/build/Build.cs index 586c415d8..c8b3c855c 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -103,11 +103,11 @@ static void DeleteCompilationArtifacts() .OnlyWhenDynamic(() => RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && Host is GitHubActions) .Executes(() => { - ProcessTasks.StartProcess("sudo", "apt install -y fonts-noto-color-emoji"); - ProcessTasks.StartProcess("mkdir", "-p /usr/local/share/fonts"); - ProcessTasks.StartProcess("cp", "/usr/share/fonts/truetype/noto/NotoColorEmoji.ttf /usr/local/share/fonts/"); - ProcessTasks.StartProcess("chmod", "644 /usr/local/share/fonts/NotoColorEmoji.ttf"); - ProcessTasks.StartProcess("fc-cache", "-fv"); + static void StartSudoProcess(string arguments) => ProcessTasks.StartProcess("sudo", arguments).WaitForExit(); + + // replace broken font - the one coming from APT doesn't contain all expected tables + StartSudoProcess("rm /usr/share/fonts/truetype/noto/NotoColorEmoji.ttf"); + StartSudoProcess("curl -sS -L -o /usr/share/fonts/truetype/noto/NotoColorEmoji-Regular.ttf https://fonts.gstatic.com/s/notocoloremoji/v25/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFab5s79iz64w.ttf"); }); Target Pack => _ => _ diff --git a/testcases/ooxml/XSSF/Streaming/TestAutoSizeColumnTracker.cs b/testcases/ooxml/XSSF/Streaming/TestAutoSizeColumnTracker.cs index 52d991ac6..0b74f0d29 100644 --- a/testcases/ooxml/XSSF/Streaming/TestAutoSizeColumnTracker.cs +++ b/testcases/ooxml/XSSF/Streaming/TestAutoSizeColumnTracker.cs @@ -142,6 +142,7 @@ public void isAllColumnsTracked() { } [Test] + [Platform("Win")] public void updateColumnWidths_and_getBestFitColumnWidth() { tracker.TrackAllColumns(); IRow row1 = sheet.CreateRow(0);