Skip to content

Commit e420a82

Browse files
committed
chore(testing): start TestAdapter at 0.0.1 and rename the publish workflow
Keep the working OIDC login/push path; drop the test gate and dispatch inputs.
1 parent 7b21b97 commit e420a82

5 files changed

Lines changed: 16 additions & 44 deletions

File tree

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
1-
name: Publish Testing
1+
name: Publish TestAdapter
22

33
on:
44
workflow_dispatch:
5-
inputs:
6-
push:
7-
description: "Push RevitDevTool.TestAdapter to nuget.org (OIDC Trusted Publishing)"
8-
type: boolean
9-
default: true
10-
nuget_user:
11-
description: "nuget.org username (profile name, not email). Required when pushing unless NUGET_USER secret exists."
12-
required: false
13-
type: string
145

156
concurrency:
16-
group: publish-testing
7+
group: publish-test-adapter
178
cancel-in-progress: false
189

1910
permissions:
@@ -33,12 +24,9 @@ jobs:
3324
uses: actions/cache@v5
3425
with:
3526
path: ~/.nuget/packages
36-
key: ${{ runner.os }}-nuget-testing-${{ hashFiles('source/DevTools.TestAdapter/**/*.csproj', 'Directory.Build.props', 'Directory.Packages.props') }}
27+
key: ${{ runner.os }}-nuget-test-adapter-${{ hashFiles('source/DevTools.TestAdapter/**/*.csproj', 'Directory.Build.props', 'Directory.Packages.props') }}
3728
restore-keys: ${{ runner.os }}-nuget-
3829

39-
- name: Test adapter
40-
run: dotnet test tests/DevTools.TestAdapter.Tests/DevTools.TestAdapter.Tests.csproj -c Release
41-
4230
- name: Pack RevitDevTool.TestAdapter
4331
id: pack
4432
shell: pwsh
@@ -50,7 +38,7 @@ jobs:
5038
}
5139
"version=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
5240
Write-Host "Package version from csproj: $version"
53-
./scripts/pack-testing.ps1
41+
./scripts/pack-test-adapter.ps1
5442
5543
- name: Upload nupkg
5644
uses: actions/upload-artifact@v4
@@ -60,33 +48,13 @@ jobs:
6048
if-no-files-found: error
6149
retention-days: 14
6250

63-
- name: Resolve nuget.org user
64-
id: nuget-user
65-
if: ${{ github.event.inputs.push == 'true' }}
66-
shell: pwsh
67-
env:
68-
NUGET_USER_SECRET: ${{ secrets.NUGET_USER }}
69-
NUGET_USER_INPUT: ${{ inputs.nuget_user }}
70-
run: |
71-
$user = if (-not [string]::IsNullOrWhiteSpace($env:NUGET_USER_SECRET)) {
72-
$env:NUGET_USER_SECRET
73-
} else {
74-
$env:NUGET_USER_INPUT
75-
}
76-
if ([string]::IsNullOrWhiteSpace($user)) {
77-
throw "Enter nuget.org profile name in the nuget_user input (not email), or set repository secret NUGET_USER."
78-
}
79-
"user=$user" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
80-
8151
- name: NuGet login (OIDC)
82-
if: ${{ github.event.inputs.push == 'true' }}
8352
uses: NuGet/login@v1
8453
id: login
8554
with:
86-
user: ${{ steps.nuget-user.outputs.user }}
55+
user: ${{ secrets.NUGET_USER }}
8756

8857
- name: Push nuget.org
89-
if: ${{ github.event.inputs.push == 'true' }}
9058
shell: pwsh
9159
env:
9260
NUGET_API_KEY: ${{ steps.login.outputs.NUGET_API_KEY }}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
Uses <Version> in source/DevTools.TestAdapter/DevTools.TestAdapter.csproj.
66
Does not push. Does not run the RevitDevTool installer pack pipeline.
77
.EXAMPLE
8-
scripts/pack-testing.ps1
9-
scripts/pack-testing.ps1 -OutputDirectory output/nuget
8+
scripts/pack-test-adapter.ps1
9+
scripts/pack-test-adapter.ps1 -OutputDirectory output/nuget
1010
#>
1111
param(
1212
[string]$OutputDirectory = 'output/nuget'

source/DevTools.TestAdapter/DevTools.TestAdapter.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
<RootNamespace>DevTools.TestAdapter</RootNamespace>
88
<AssemblyName>DevTools.TestAdapter</AssemblyName>
99
<PackageId>RevitDevTool.TestAdapter</PackageId>
10-
<!-- Bump this before running .github/workflows/PublishTesting.yml.
10+
<!-- Bump this before running .github/workflows/PublishTestAdapter.yml.
1111
Independent of the RevitDevTool installer GitVersion. -->
12-
<Version>0.1.0</Version>
12+
<Version>0.0.1</Version>
1313
<IsPackable>true</IsPackable>
1414
<DevelopmentDependency>true</DevelopmentDependency>
1515
<PackageLicenseExpression>MIT</PackageLicenseExpression>

source/DevTools.TestAdapter/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@ The adapter reads the `devtools` section through MTP `IConfiguration`. Do not us
1919
<IsTestProject>true</IsTestProject>
2020
<OutputType>Exe</OutputType>
2121
<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
22+
<!-- required -->
2223
<HostName>Revit</HostName>
2324
<HostVersion>$(RevitVersion)</HostVersion>
25+
<!-- default -->
2426
<ForceLaunch>false</ForceLaunch>
2527
<PerTestTimeout>60</PerTestTimeout>
26-
<LaunchTimeout>360</LaunchTimeout>
28+
<LaunchTimeout>180</LaunchTimeout>
29+
<TestingFramework>nunit</TestingFramework>
30+
<TestingDiscoveryAttributes>TestAttribute;TestCaseAttribute;TestCaseSourceAttribute;TheoryAttribute</TestingDiscoveryAttributes>
2731
</PropertyGroup>
2832
<ItemGroup>
2933
<PackageReference Include="RevitDevTool.TestAdapter" />

tests/DevTools.TestAdapter.Tests/PackageConsumerTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ synthetic executable to launch a CAD host. -->
5454
</PropertyGroup>
5555
<ItemGroup>
5656
<Compile Remove="ProviderLeak.cs" />
57-
<PackageReference Include="RevitDevTool.TestAdapter" Version="0.1.0" />
57+
<PackageReference Include="RevitDevTool.TestAdapter" Version="0.0.1" />
5858
<PackageReference Include="Microsoft.Testing.Platform.MSBuild" Version="2.3.3" />
5959
<PackageReference Include="NUnit" Version="4.6.1" />
6060
</ItemGroup>
@@ -87,7 +87,7 @@ synthetic executable to launch a CAD host. -->
8787
</PropertyGroup>
8888
<ItemGroup>
8989
<Compile Include="ProviderLeak.cs" />
90-
<PackageReference Include="RevitDevTool.TestAdapter" Version="0.1.0" />
90+
<PackageReference Include="RevitDevTool.TestAdapter" Version="0.0.1" />
9191
<PackageReference Include="Microsoft.Testing.Platform.MSBuild" Version="2.3.3" />
9292
<PackageReference Include="NUnit" Version="4.6.1" />
9393
</ItemGroup>

0 commit comments

Comments
 (0)