Skip to content

Commit 7f206ea

Browse files
committed
fix: please fix CI/CD
1 parent b692139 commit 7f206ea

6 files changed

Lines changed: 66 additions & 94 deletions

File tree

examples/starter/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*/AGENTS.md

examples/starter/project.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "templates",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"projectType": "library",
5+
"sourceRoot": "examples/starter",
6+
"targets": {
7+
"_inject_template_version": {
8+
"//": "Stamps the current Directory.Build.props version into all starter template.json files",
9+
"executor": "nx:run-commands",
10+
"options": {
11+
"commands": ["bash scripts/inject-template-version.sh"],
12+
"cwd": "{workspaceRoot}",
13+
"parallel": false
14+
}
15+
},
16+
"_inject_agents_md": {
17+
"//": "Copies the canonical AGENTS.md into each starter template before packing",
18+
"executor": "nx:run-commands",
19+
"options": {
20+
"commands": [
21+
"cp docs/guides/misc/AGENTS.md examples/starter/KedroIris/AGENTS.md",
22+
"cp docs/guides/misc/AGENTS.md examples/starter/KedroIrisPython/AGENTS.md",
23+
"cp docs/guides/misc/AGENTS.md examples/starter/KedroSpaceflights/AGENTS.md",
24+
"cp docs/guides/misc/AGENTS.md examples/starter/KedroSpaceflightsPython/AGENTS.md",
25+
"cp docs/guides/misc/AGENTS.md examples/starter/Minimal/AGENTS.md",
26+
"cp docs/guides/misc/AGENTS.md examples/starter/SpaceflightsEFCore/AGENTS.md"
27+
],
28+
"cwd": "{workspaceRoot}",
29+
"parallel": false
30+
}
31+
}
32+
}
33+
}

nx.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@
66
"targetDefaults": {
77
"build": {
88
"dependsOn": [ "restore", "^build" ]
9+
},
10+
"build:release": {
11+
"dependsOn": [ "restore", "^build:release" ]
12+
},
13+
"test": {
14+
"dependsOn": [ "build" ]
15+
},
16+
"pack": {
17+
"dependsOn": [ "build:release", "templates:_inject_template_version", "templates:_inject_agents_md" ]
918
}
1019
},
1120
"namedInputs": {

project.json

Lines changed: 3 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,10 @@
44
"projectType": "library",
55
"sourceRoot": ".",
66
"targets": {
7-
"test": {
8-
"//": "Run all tests across the solution with code coverage",
9-
"executor": "nx:run-commands",
10-
"options": {
11-
"commands": [
12-
"pnpm nx run-many -t test --projects=tag:type:test --output-style=stream"
13-
],
14-
"parallel": false
15-
}
16-
},
177
"coverage:badges": {
188
"//": "Generate coverage badges from the most recent test run results",
199
"executor": "nx:run-commands",
20-
"dependsOn": [ "test" ],
10+
"dependsOn": [ ],
2111
"options": {
2212
"commands": [
2313
"reportgenerator \"-reports:tests/**/TestResults/**/coverage.cobertura.xml\" \"-targetdir:coverage-badges\" \"-reporttypes:Badges\" \"-verbosity:Warning\""
@@ -28,7 +18,7 @@
2818
"coverage:report": {
2919
"//": "Generate HTML coverage report from the most recent test run results",
3020
"executor": "nx:run-commands",
31-
"dependsOn": [ "test" ],
21+
"dependsOn": [ ],
3222
"options": {
3323
"commands": [
3424
"reportgenerator \"-reports:tests/**/TestResults/**/coverage.cobertura.xml\" \"-targetdir:CoverageReport\" \"-reporttypes:Html;Badges\" \"-verbosity:Info\""
@@ -39,35 +29,14 @@
3929
"ci": {
4030
"//": "Full local CI: run tests and generate HTML coverage report",
4131
"executor": "nx:run-commands",
42-
"dependsOn": [ "coverage:report" ],
32+
"dependsOn": [ ],
4333
"options": {
4434
"commands": [
4535
"echo '✓ CI pipeline complete'"
4636
],
4737
"parallel": false
4838
}
4939
},
50-
"pack": {
51-
"//": "Build release config and pack all NuGet packages into dist/packages/",
52-
"executor": "nx:run-commands",
53-
"options": {
54-
"commands": [
55-
"echo 'Cleaning previous packages...'",
56-
"rm -rf dist/packages 2>/dev/null || true",
57-
"echo 'Building release configuration...'",
58-
"pnpm nx run-many -t build:release --projects=tag:nuget --output-style=stream",
59-
"echo 'Injecting version into templates...'",
60-
"./scripts/inject-template-version.sh",
61-
"echo 'Injecting AGENTS.md into starter templates...'",
62-
"pnpm nx run flowthru:_inject_agents_md",
63-
"echo 'Packing NuGet packages...'",
64-
"pnpm nx run-many -t pack --projects=tag:nuget --output-style=stream",
65-
"echo '\\u2713 NuGet packages created:'",
66-
"ls -lh dist/packages/*.nupkg"
67-
],
68-
"parallel": false
69-
}
70-
},
7140
"release": {
7241
"//": "Determine next version via NX Release, sync to Directory.Build.props, generate changelog, create GitHub Release",
7342
"executor": "nx:run-commands",
@@ -78,21 +47,6 @@
7847
"parallel": false
7948
}
8049
},
81-
"_inject_agents_md": {
82-
"//": "Copies the canonical AGENTS.md into each starter template before packing",
83-
"executor": "nx:run-commands",
84-
"options": {
85-
"commands": [
86-
"cp docs/guides/misc/AGENTS.md examples/starter/KedroIris/AGENTS.md",
87-
"cp docs/guides/misc/AGENTS.md examples/starter/KedroIrisPython/AGENTS.md",
88-
"cp docs/guides/misc/AGENTS.md examples/starter/KedroSpaceflights/AGENTS.md",
89-
"cp docs/guides/misc/AGENTS.md examples/starter/KedroSpaceflightsPython/AGENTS.md",
90-
"cp docs/guides/misc/AGENTS.md examples/starter/Minimal/AGENTS.md",
91-
"cp docs/guides/misc/AGENTS.md examples/starter/SpaceflightsEFCore/AGENTS.md"
92-
],
93-
"parallel": false
94-
}
95-
},
9650
"format": {
9751
"//": "Applies all formatting for the project",
9852
"executor": "nx:run-commands",

tests/Flowthru.Tests.Templates/Flowthru.Tests.Templates.csproj

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -20,49 +20,4 @@
2020
<Using Include="NUnit.Framework" />
2121
</ItemGroup>
2222

23-
<!--
24-
Ensures dist/packages/ always contains freshly-packed Flowthru NuGet packages
25-
at the current repository version before the test project builds.
26-
27-
This makes `dotnet test` at the repo root self-contained: no manual `nx run
28-
flowthru:publish` step is required.
29-
30-
Set SkipTemplatePack=true to bypass when iterating quickly and packages are
31-
already known-good:
32-
dotnet test /p:SkipTemplatePack=true
33-
-->
34-
<Target Name="PackFlowthruForTemplateTests"
35-
BeforeTargets="Build"
36-
Condition="'$(SkipTemplatePack)' != 'true'">
37-
38-
<!-- Stamp the current Directory.Build.props version into every template.json -->
39-
<Exec Command="bash &quot;$(RepoRoot)scripts/inject-template-version.sh&quot;"
40-
WorkingDirectory="$(RepoRoot)"
41-
ConsoleToMSBuild="true" />
42-
43-
<!--
44-
Clear stale nupkgs so only the current version exists in the local feed.
45-
Without this, a previously-packed older version satisfies transitive
46-
dependency resolution before the freshly-built packages are considered.
47-
-->
48-
<RemoveDir Directories="$(RepoRoot)dist\packages" />
49-
<MakeDir Directories="$(RepoRoot)dist\packages" />
50-
51-
<!--
52-
Pack every src/ project. Non-packable projects (IsPackable=false) are
53-
no-ops, so the glob is safe to expand without a central list. This
54-
automatically captures all transitive Flowthru* dependencies (Core, Csv,
55-
Parquet, Excel, etc.) whenever the dependency tree changes.
56-
-->
57-
<ItemGroup>
58-
<_PackableProject Include="$(RepoRoot)src\**\*.csproj" />
59-
</ItemGroup>
60-
61-
<MSBuild Projects="@(_PackableProject)"
62-
Targets="Pack"
63-
Properties="Configuration=Release;PackageOutputPath=$(RepoRoot)dist\packages"
64-
BuildInParallel="false" />
65-
66-
</Target>
67-
6823
</Project>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "Flowthru.Tests.Templates",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"projectType": "application",
5+
"sourceRoot": "tests/Flowthru.Tests.Templates",
6+
"tags": [ "type:test" ],
7+
"targets": {
8+
"test": {
9+
"//": "Runs template tests. Requires all tag:nuget packs to be in dist/packages/ first.",
10+
"executor": "nx:run-commands",
11+
"dependsOn": [ "build", { "target": "pack" } ],
12+
"options": {
13+
"commands": [ "dotnet test --no-build --no-restore" ],
14+
"cwd": "tests/Flowthru.Tests.Templates",
15+
"parallel": false,
16+
"forwardAllArgs": true
17+
}
18+
}
19+
}
20+
}

0 commit comments

Comments
 (0)