Skip to content

Commit 789ab5b

Browse files
committed
fix(workflows): expand platform support and clean up arguments
Added platform matrix support for GitHub Actions workflows, enabling testing across `windows-latest`, `windows-11-arm`, `ubuntu-latest`, `ubuntu-24.04-arm`, `macos-15-intel`, and `macos-latest`. Removed `AtomArguments` and adjusted related logic for cleaner command structure. Standardized command syntax for `dotnet run` to improve readability and maintainability.
1 parent 35ba2aa commit 789ab5b

File tree

7 files changed

+50
-52
lines changed

7 files changed

+50
-52
lines changed

.github/workflows/Build.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,15 @@ jobs:
4646

4747
- name: SetupBuildInfo
4848
id: SetupBuildInfo
49-
run: ${{ steps.cache-restore-atom-build.outputs.cache-hit && format('.atom/{0} -- SetupBuildInfo --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom') || 'dotnet run --project _atom/_atom.csproj -- SetupBuildInfo --skip --headless' }}
49+
run: ${{ steps.cache-restore-atom-build.outputs.cache-hit && format('.atom/{0} SetupBuildInfo --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom') || 'dotnet run --project _atom/_atom.csproj-- SetupBuildInfo --skip --headless' }}
5050
env:
5151
pull-request-number: ${{ github.event.number }}
5252

5353
BuildAtom:
54-
runs-on: ubuntu-latest
54+
strategy:
55+
matrix:
56+
job-runs-on: [ windows-latest, windows-11-arm, ubuntu-latest, ubuntu-24.04-arm, macos-15-intel, macos-latest ]
57+
runs-on: ${{ matrix.job-runs-on }}
5558
steps:
5659

5760
- name: Checkout
@@ -73,7 +76,10 @@ jobs:
7376

7477
- name: BuildAtom
7578
id: BuildAtom
76-
run: ${{ steps.cache-restore-atom-build.outputs.cache-hit && format('.atom/{0} -- BuildAtom --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom') || 'dotnet run --project _atom/_atom.csproj -- BuildAtom --skip --headless' }}
79+
run: ${{ steps.cache-restore-atom-build.outputs.cache-hit && format('.atom/{0} BuildAtom --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom') || 'dotnet run --project _atom/_atom.csproj-- BuildAtom --skip --headless' }}
80+
env:
81+
job-runs-on: ${{ matrix.job-runs-on }}
82+
build-slice: ${{ matrix.job-runs-on }}
7783

7884
- run: |
7985
git reset --hard HEAD
@@ -111,7 +117,7 @@ jobs:
111117

112118
- name: PackProjects
113119
id: PackProjects
114-
run: ${{ steps.cache-restore-atom-build.outputs.cache-hit && format('.atom/{0} -- PackProjects --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom') || 'dotnet run --project _atom/_atom.csproj -- PackProjects --skip --headless' }}
120+
run: ${{ steps.cache-restore-atom-build.outputs.cache-hit && format('.atom/{0} PackProjects --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom') || 'dotnet run --project _atom/_atom.csproj-- PackProjects --skip --headless' }}
115121

116122
- name: Upload DecSm.Atom
117123
uses: actions/upload-artifact@v4
@@ -181,7 +187,7 @@ jobs:
181187

182188
- name: PackTool
183189
id: PackTool
184-
run: ${{ steps.cache-restore-atom-build.outputs.cache-hit && format('.atom/{0} -- PackTool --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom') || 'dotnet run --project _atom/_atom.csproj -- PackTool --skip --headless' }}
190+
run: ${{ steps.cache-restore-atom-build.outputs.cache-hit && format('.atom/{0} PackTool --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom') || 'dotnet run --project _atom/_atom.csproj-- PackTool --skip --headless' }}
185191
env:
186192
job-runs-on: ${{ matrix.job-runs-on }}
187193
build-slice: ${{ matrix.job-runs-on }}
@@ -227,7 +233,7 @@ jobs:
227233

228234
- name: TestProjects
229235
id: TestProjects
230-
run: ${{ steps.cache-restore-atom-build.outputs.cache-hit && format('.atom/{0} -- TestProjects --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom') || 'dotnet run --project _atom/_atom.csproj -- TestProjects --skip --headless' }}
236+
run: ${{ steps.cache-restore-atom-build.outputs.cache-hit && format('.atom/{0} TestProjects --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom') || 'dotnet run --project _atom/_atom.csproj-- TestProjects --skip --headless' }}
231237
env:
232238
job-runs-on: ${{ matrix.job-runs-on }}
233239
test-framework: ${{ matrix.test-framework }}
@@ -371,7 +377,7 @@ jobs:
371377

372378
- name: PushToNuget
373379
id: PushToNuget
374-
run: ${{ steps.cache-restore-atom-build.outputs.cache-hit && format('.atom/{0} -- PushToNuget --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom') || 'dotnet run --project _atom/_atom.csproj -- PushToNuget --skip --headless' }}
380+
run: ${{ steps.cache-restore-atom-build.outputs.cache-hit && format('.atom/{0} PushToNuget --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom') || 'dotnet run --project _atom/_atom.csproj-- PushToNuget --skip --headless' }}
375381
env:
376382
build-id: ${{ needs.SetupBuildInfo.outputs.build-id }}
377383
azure-vault-app-secret: ${{ secrets.AZURE_VAULT_APP_SECRET }}
@@ -1132,7 +1138,7 @@ jobs:
11321138

11331139
- name: PushToRelease
11341140
id: PushToRelease
1135-
run: ${{ steps.cache-restore-atom-build.outputs.cache-hit && format('.atom/{0} -- PushToRelease --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom') || 'dotnet run --project _atom/_atom.csproj -- PushToRelease --skip --headless' }}
1141+
run: ${{ steps.cache-restore-atom-build.outputs.cache-hit && format('.atom/{0} PushToRelease --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom') || 'dotnet run --project _atom/_atom.csproj-- PushToRelease --skip --headless' }}
11361142
env:
11371143
build-version: ${{ needs.SetupBuildInfo.outputs.build-version }}
11381144
azure-vault-app-secret: ${{ secrets.AZURE_VAULT_APP_SECRET }}

.github/workflows/Dependabot Enable auto-merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636

3737
- name: ApproveDependabotPr
3838
id: ApproveDependabotPr
39-
run: ${{ steps.cache-restore-atom-build.outputs.cache-hit && format('.atom/{0} -- ApproveDependabotPr --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom') || 'dotnet run --project _atom/_atom.csproj -- ApproveDependabotPr --skip --headless' }}
39+
run: ${{ steps.cache-restore-atom-build.outputs.cache-hit && format('.atom/{0} ApproveDependabotPr --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom') || 'dotnet run --project _atom/_atom.csproj-- ApproveDependabotPr --skip --headless' }}
4040
env:
4141
azure-vault-app-secret: ${{ secrets.AZURE_VAULT_APP_SECRET }}
4242
azure-vault-address: ${{ vars.AZURE_VAULT_ADDRESS }}

.github/workflows/Validate.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,15 @@ jobs:
4141

4242
- name: SetupBuildInfo
4343
id: SetupBuildInfo
44-
run: ${{ steps.cache-restore-atom-build.outputs.cache-hit && format('.atom/{0} -- SetupBuildInfo --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom') || 'dotnet run --project _atom/_atom.csproj -- SetupBuildInfo --skip --headless' }}
44+
run: ${{ steps.cache-restore-atom-build.outputs.cache-hit && format('.atom/{0} SetupBuildInfo --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom') || 'dotnet run --project _atom/_atom.csproj-- SetupBuildInfo --skip --headless' }}
4545
env:
4646
pull-request-number: ${{ github.event.number }}
4747

4848
BuildAtom:
49-
runs-on: ubuntu-latest
49+
strategy:
50+
matrix:
51+
job-runs-on: [ windows-latest, windows-11-arm, ubuntu-latest, ubuntu-24.04-arm, macos-15-intel, macos-latest ]
52+
runs-on: ${{ matrix.job-runs-on }}
5053
steps:
5154

5255
- name: Checkout
@@ -68,7 +71,10 @@ jobs:
6871

6972
- name: BuildAtom
7073
id: BuildAtom
71-
run: ${{ steps.cache-restore-atom-build.outputs.cache-hit && format('.atom/{0} -- BuildAtom --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom') || 'dotnet run --project _atom/_atom.csproj -- BuildAtom --skip --headless' }}
74+
run: ${{ steps.cache-restore-atom-build.outputs.cache-hit && format('.atom/{0} BuildAtom --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom') || 'dotnet run --project _atom/_atom.csproj-- BuildAtom --skip --headless' }}
75+
env:
76+
job-runs-on: ${{ matrix.job-runs-on }}
77+
build-slice: ${{ matrix.job-runs-on }}
7278

7379
- run: |
7480
git reset --hard HEAD
@@ -106,7 +112,7 @@ jobs:
106112

107113
- name: PackProjects
108114
id: PackProjects
109-
run: ${{ steps.cache-restore-atom-build.outputs.cache-hit && format('.atom/{0} -- PackProjects --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom') || 'dotnet run --project _atom/_atom.csproj -- PackProjects --skip --headless' }}
115+
run: ${{ steps.cache-restore-atom-build.outputs.cache-hit && format('.atom/{0} PackProjects --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom') || 'dotnet run --project _atom/_atom.csproj-- PackProjects --skip --headless' }}
110116

111117
PackTool:
112118
strategy:
@@ -134,7 +140,7 @@ jobs:
134140

135141
- name: PackTool
136142
id: PackTool
137-
run: ${{ steps.cache-restore-atom-build.outputs.cache-hit && format('.atom/{0} -- PackTool --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom') || 'dotnet run --project _atom/_atom.csproj -- PackTool --skip --headless' }}
143+
run: ${{ steps.cache-restore-atom-build.outputs.cache-hit && format('.atom/{0} PackTool --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom') || 'dotnet run --project _atom/_atom.csproj-- PackTool --skip --headless' }}
138144
env:
139145
job-runs-on: ${{ matrix.job-runs-on }}
140146
build-slice: ${{ matrix.job-runs-on }}
@@ -174,7 +180,7 @@ jobs:
174180

175181
- name: TestProjects
176182
id: TestProjects
177-
run: ${{ steps.cache-restore-atom-build.outputs.cache-hit && format('.atom/{0} -- TestProjects --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom') || 'dotnet run --project _atom/_atom.csproj -- TestProjects --skip --headless' }}
183+
run: ${{ steps.cache-restore-atom-build.outputs.cache-hit && format('.atom/{0} TestProjects --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom') || 'dotnet run --project _atom/_atom.csproj-- TestProjects --skip --headless' }}
178184
env:
179185
job-runs-on: ${{ matrix.job-runs-on }}
180186
test-framework: ${{ matrix.test-framework }}
@@ -245,7 +251,7 @@ jobs:
245251

246252
- name: CheckPrForBreakingChanges
247253
id: CheckPrForBreakingChanges
248-
run: ${{ steps.cache-restore-atom-build.outputs.cache-hit && format('.atom/{0} -- CheckPrForBreakingChanges --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom') || 'dotnet run --project _atom/_atom.csproj -- CheckPrForBreakingChanges --skip --headless' }}
254+
run: ${{ steps.cache-restore-atom-build.outputs.cache-hit && format('.atom/{0} CheckPrForBreakingChanges --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom') || 'dotnet run --project _atom/_atom.csproj-- CheckPrForBreakingChanges --skip --headless' }}
249255
env:
250256
build-version: ${{ needs.SetupBuildInfo.outputs.build-version }}
251257
azure-vault-app-secret: ${{ secrets.AZURE_VAULT_APP_SECRET }}

DecSm.Atom.Module.GithubWorkflows/Generation/GithubWorkflowWriter.cs

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -754,18 +754,6 @@ private void WriteCommandStep(
754754
WriteLine($"if: {condition}");
755755
}
756756

757-
var atomArguments = workflow
758-
.Options
759-
.Concat(workflowStep.Options)
760-
.OfType<AtomArguments>()
761-
.SelectMany(x => x.Arguments)
762-
.Distinct()
763-
.ToList();
764-
765-
var atomArgumentsString = atomArguments.Count > 0
766-
? $"{string.Join(" ", atomArguments)} "
767-
: string.Empty;
768-
769757
var customAtomCommand = workflow
770758
.Options
771759
.Concat(workflowStep.Options)
@@ -774,7 +762,7 @@ private void WriteCommandStep(
774762

775763
if (customAtomCommand is not null)
776764
{
777-
WriteLine(customAtomCommand.Write(workflow, workflowStep, _fileSystem, atomArgumentsString));
765+
WriteLine(customAtomCommand.Write(workflow, workflowStep, _fileSystem));
778766
}
779767
else
780768
{
@@ -787,14 +775,13 @@ private void WriteCommandStep(
787775
_fileSystem.FileSystem.Path.GetRelativePath(_fileSystem.AtomRootDirectory, fileName);
788776

789777
WriteLine(
790-
$"run: dotnet run --file {filePathRelativeToRoot} {atomArgumentsString}-- {workflowStep.Name} --skip --headless");
778+
$"run: dotnet run --file {filePathRelativeToRoot} -- {workflowStep.Name} --skip --headless");
791779
}
792780
else
793781
{
794782
var projectPath = FindProjectPath(_fileSystem, _fileSystem.ProjectName);
795783

796-
WriteLine(
797-
$"run: dotnet run --project {projectPath} {atomArgumentsString}-- {workflowStep.Name} --skip --headless");
784+
WriteLine($"run: dotnet run --project {projectPath} -- {workflowStep.Name} --skip --headless");
798785
}
799786
}
800787

@@ -952,7 +939,7 @@ private void WriteCommandStep(
952939
}
953940
}
954941

955-
foreach (var cleanAtomDirectory in workflow
942+
foreach (var _ in workflow
956943
.Options
957944
.Concat(workflowStep.Options)
958945
.OfType<CleanAtomDirectory>())

DecSm.Atom/Experimental/AtomArguments.cs

Lines changed: 0 additions & 4 deletions
This file was deleted.

DecSm.Atom/Experimental/Sandbox.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ public sealed record CustomAtomCommand : IWorkflowOption
66
public string Write(
77
WorkflowModel workflow,
88
WorkflowStepModel workflowStep,
9-
IAtomFileSystem fileSystem,
10-
string customArgs)
9+
IAtomFileSystem fileSystem)
1110
{
1211
var cacheHitCommand =
13-
$"format('.atom/{{0}} {customArgs}-- {workflowStep.Name} --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom')";
12+
$"format('.atom/{{0}} {workflowStep.Name} --skip --headless', runner.os == 'windows' && '_atom.exe' || '_atom')";
1413

1514
string cacheMissCommand;
1615

@@ -22,15 +21,13 @@ public string Write(
2221
var filePathRelativeToRoot =
2322
fileSystem.FileSystem.Path.GetRelativePath(fileSystem.AtomRootDirectory, fileName);
2423

25-
cacheMissCommand =
26-
$"'dotnet run --file {filePathRelativeToRoot} {customArgs}-- {workflowStep.Name} --skip --headless'";
24+
cacheMissCommand = $"'dotnet run --file {filePathRelativeToRoot}-- {workflowStep.Name} --skip --headless'";
2725
}
2826
else
2927
{
3028
var projectPath = FindProjectPath(fileSystem, fileSystem.ProjectName);
3129

32-
cacheMissCommand =
33-
$"'dotnet run --project {projectPath} {customArgs}-- {workflowStep.Name} --skip --headless'";
30+
cacheMissCommand = $"'dotnet run --project {projectPath}-- {workflowStep.Name} --skip --headless'";
3431
}
3532

3633
// return $"run: ${{{{ steps.cache-restore-atom-build.outputs.cache-hit == 'true' }}}}";

_atom/Build.cs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,13 @@ internal partial class Build : BuildDefinition,
7878
})
7979
.WithOptions(WorkflowOptions.Inject.Param(WorkflowParams.PullRequestNumber,
8080
"github.event.number")),
81-
WorkflowTargets.BuildAtom.WithOptions(new CleanAtomDirectory(),
82-
WorkflowOptions.Cache.Save("atom-build",
83-
"${{ format('{0}-atom-build-{1}', runner.os, hashFiles('_atom/**/*.cs', '_atom/appsettings.json', '_atom/packages.lock.json')) }}",
84-
["${{ github.workspace }}/.atom"])),
81+
WorkflowTargets
82+
.BuildAtom
83+
.WithGithubRunsOnMatrix(PlatformNames)
84+
.WithOptions(new CleanAtomDirectory(),
85+
WorkflowOptions.Cache.Save("atom-build",
86+
"${{ format('{0}-atom-build-{1}', runner.os, hashFiles('_atom/**/*.cs', '_atom/appsettings.json', '_atom/packages.lock.json')) }}",
87+
["${{ github.workspace }}/.atom"])),
8588
WorkflowTargets.PackProjects.WithSuppressedArtifactPublishing,
8689
WorkflowTargets.PackTool.WithSuppressedArtifactPublishing.WithGithubRunsOnMatrix(PlatformNames),
8790
WorkflowTargets
@@ -127,10 +130,13 @@ internal partial class Build : BuildDefinition,
127130
})
128131
.WithOptions(WorkflowOptions.Inject.Param(WorkflowParams.PullRequestNumber,
129132
"github.event.number")),
130-
WorkflowTargets.BuildAtom.WithOptions(new CleanAtomDirectory(),
131-
WorkflowOptions.Cache.Save("atom-build",
132-
"${{ format('{0}-atom-build-{1}', runner.os, hashFiles('_atom/**/*.cs', '_atom/appsettings.json', '_atom/packages.lock.json')) }}",
133-
["${{ github.workspace }}/.atom"])),
133+
WorkflowTargets
134+
.BuildAtom
135+
.WithGithubRunsOnMatrix(PlatformNames)
136+
.WithOptions(new CleanAtomDirectory(),
137+
WorkflowOptions.Cache.Save("atom-build",
138+
"${{ format('{0}-atom-build-{1}', runner.os, hashFiles('_atom/**/*.cs', '_atom/appsettings.json', '_atom/packages.lock.json')) }}",
139+
["${{ github.workspace }}/.atom"])),
134140
WorkflowTargets.PackProjects,
135141
WorkflowTargets.PackTool.WithGithubRunsOnMatrix(PlatformNames),
136142
WorkflowTargets

0 commit comments

Comments
 (0)