Skip to content

Commit

Permalink
Install required font on Linux CI run
Browse files Browse the repository at this point in the history
  • Loading branch information
lahma committed Jun 17, 2023
1 parent a3ec182 commit b162180
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
windows-latest:
name: windows-latest
runs-on: windows-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
- name: 'Cache: .nuke/temp, ~/.nuget/packages'
Expand All @@ -45,6 +46,7 @@ jobs:
ubuntu-latest:
name: ubuntu-latest
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
- name: 'Cache: .nuke/temp, ~/.nuget/packages'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
windows-latest:
name: windows-latest
runs-on: windows-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
- name: 'Cache: .nuke/temp, ~/.nuget/packages'
Expand All @@ -41,6 +42,7 @@ jobs:
ubuntu-latest:
name: ubuntu-latest
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
- name: 'Cache: .nuke/temp, ~/.nuget/packages'
Expand Down
2 changes: 2 additions & 0 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"enum": [
"Clean",
"Compile",
"InstallFonts",
"Pack",
"Restore",
"Test"
Expand All @@ -97,6 +98,7 @@
"enum": [
"Clean",
"Compile",
"InstallFonts",
"Pack",
"Restore",
"Test"
Expand Down
6 changes: 4 additions & 2 deletions build/Build.GitHubAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
GitHubActionsImage.WindowsLatest,
GitHubActionsImage.UbuntuLatest,
OnPushBranches = new[] { "main", "master" },
InvokedTargets = new[] { nameof(Clean), nameof(Test), nameof(Pack) }
InvokedTargets = new[] { nameof(Clean), nameof(Test), nameof(Pack) },
TimeoutMinutes = 20
)]
[GitHubActions("PR",
GitHubActionsImage.WindowsLatest,
GitHubActionsImage.UbuntuLatest,
On = new [] { GitHubActionsTrigger.PullRequest },
InvokedTargets = new[] { nameof(Clean), nameof(Test), nameof(Pack) }
InvokedTargets = new[] { nameof(Clean), nameof(Test), nameof(Pack) },
TimeoutMinutes = 20
)]
partial class Build
{
Expand Down
10 changes: 10 additions & 0 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ protected override void OnBuildInitialized()

Target Test => _ => _
.DependsOn(Compile)
.DependsOn(InstallFonts)
.Executes(() =>
{
DotNetTest(_ =>_
Expand All @@ -87,6 +88,15 @@ protected override void OnBuildInitialized()
);
});

Target InstallFonts => _ => _
.OnlyWhenDynamic(() => RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
.Executes(() =>
{
//ProcessTasks.StartProcess("sudo", "apt update");
ProcessTasks.StartProcess("/bin/sh", "-c \"echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections\"");
ProcessTasks.StartProcess("sudo", "apt install -y fontconfig ttf-mscorefonts-installer");
});

Target Pack => _ => _
.After(Test)
.Produces(ArtifactsDirectory / "**")
Expand Down

0 comments on commit b162180

Please sign in to comment.