fix handling of rounding to 12 inches in FeetInches #93
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: UnitsNet.Modular CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| tags: | |
| - 'UnitsNet.Modular/*' | |
| paths: | |
| - '.devcontainer/unitsnet-modular/**' | |
| - 'UnitsNet.Modular/**' | |
| # The compatibility suite compiles the current UnitsNet project to detect source/API drift. | |
| - 'UnitsNet/**' | |
| - 'Common/UnitDefinitions/**' | |
| - 'Common/UnitRelations.json' | |
| - 'Common/UnitEnumValues.g.json' | |
| - 'UnitsNet.Modular.slnx' | |
| - 'Directory.Build.props' | |
| - 'Directory.Packages.props' | |
| - 'NuGet.Config' | |
| - 'NullableAttributes.cs' | |
| - 'global.json' | |
| - '.github/workflows/unitsnet-modular-ci.yml' | |
| pull_request: | |
| branches: | |
| - master | |
| paths: | |
| - '.devcontainer/unitsnet-modular/**' | |
| - 'UnitsNet.Modular/**' | |
| # The compatibility suite compiles the current UnitsNet project to detect source/API drift. | |
| - 'UnitsNet/**' | |
| - 'Common/UnitDefinitions/**' | |
| - 'Common/UnitRelations.json' | |
| - 'Common/UnitEnumValues.g.json' | |
| - 'UnitsNet.Modular.slnx' | |
| - 'Directory.Build.props' | |
| - 'Directory.Packages.props' | |
| - 'NuGet.Config' | |
| - 'NullableAttributes.cs' | |
| - 'global.json' | |
| - '.github/workflows/unitsnet-modular-ci.yml' | |
| workflow_dispatch: | |
| inputs: | |
| publish_nuget: | |
| description: Publish to nuget.org (UnitsNet.Modular/* tag only) | |
| required: true | |
| default: false | |
| type: boolean | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: unitsnet-modular-ci-${{ github.ref }} | |
| # Never interrupt a release-tag run while it may be publishing immutable packages. | |
| cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/UnitsNet.Modular/') }} | |
| env: | |
| DOTNET_CLI_TELEMETRY_OPTOUT: true | |
| DOTNET_NOLOGO: true | |
| DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | |
| jobs: | |
| build-test-pack: | |
| name: Build, test, and pack | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout full history | |
| uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET SDK | |
| uses: actions/setup-dotnet@v6 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Restore | |
| run: dotnet restore UnitsNet.Modular.slnx -p:Platform=ProjectReferences | |
| - name: Build | |
| run: dotnet build UnitsNet.Modular.slnx --configuration Release --no-restore --no-incremental -p:Platform=ProjectReferences | |
| - name: Test | |
| run: dotnet test UnitsNet.Modular.slnx --configuration Release --no-build -p:Platform=ProjectReferences | |
| - name: Native AOT smoke test | |
| run: | | |
| dotnet publish UnitsNet.Modular/Samples/QuantitySelectionSample/QuantitySelectionSample.csproj \ | |
| --configuration Release \ | |
| --framework net10.0 \ | |
| --runtime linux-x64 \ | |
| --self-contained true \ | |
| -p:PublishAot=true \ | |
| -p:Platform=ProjectReferences \ | |
| --output Artifacts/UnitsNet.Modular.AotSmoke | |
| ./Artifacts/UnitsNet.Modular.AotSmoke/QuantitySelectionSample | |
| - name: Run getting-started NuGet consumer | |
| shell: pwsh | |
| run: ./UnitsNet.Modular/Samples/GettingStartedSample/run.ps1 | |
| - name: Run custom-definition NuGet consumer with isolated cache | |
| run: >- | |
| dotnet run | |
| --project UnitsNet.Modular/Samples/CustomQuantitySample/CustomQuantitySample.csproj | |
| --configuration Debug | |
| -p:Platform=LocalPackages | |
| -p:RestorePackagesPath=${{ runner.temp }}/unitsnet-modular-custom-packages-${{ github.run_id }}-${{ github.run_attempt }} | |
| - name: Run published-package consumer | |
| run: >- | |
| dotnet run | |
| --project UnitsNet.Modular/Samples/GettingStartedSample/GettingStartedSample.csproj | |
| --configuration Release | |
| -p:Platform=PublishedPackages | |
| - name: Pack | |
| run: dotnet pack UnitsNet.Modular/UnitsNet.Modular/UnitsNet.Modular.csproj --configuration Release --no-build --output Artifacts/UnitsNet.Modular.CI -p:UnitsNetModularPackForPublish=true | |
| - name: Verify tagged package versions | |
| if: startsWith(github.ref, 'refs/tags/UnitsNet.Modular/') | |
| shell: pwsh | |
| run: | | |
| $tagRefPrefix = 'refs/tags/UnitsNet.Modular/' | |
| if (-not $env:GITHUB_REF.StartsWith($tagRefPrefix, [StringComparison]::Ordinal)) { | |
| throw "Expected ref '$env:GITHUB_REF' to start with '$tagRefPrefix'." | |
| } | |
| $expectedVersion = $env:GITHUB_REF.Substring($tagRefPrefix.Length) | |
| $packageDirectory = 'Artifacts/UnitsNet.Modular.CI' | |
| $packagePath = Join-Path $packageDirectory "UnitsNet.Modular.$expectedVersion.nupkg" | |
| if (-not (Test-Path -LiteralPath $packagePath -PathType Leaf)) { | |
| throw "Expected tagged package was not produced: $packagePath" | |
| } | |
| - name: Upload packages | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: unitsnet-modular-packages-${{ github.sha }} | |
| path: | | |
| Artifacts/UnitsNet.Modular.CI/*.nupkg | |
| Artifacts/UnitsNet.Modular.CI/*.snupkg | |
| if-no-files-found: error | |
| retention-days: 14 | |
| publish-nuget: | |
| name: Publish NuGet packages | |
| needs: build-test-pack | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| if: >- | |
| github.repository_owner == 'angularsen' && | |
| startsWith(github.ref, 'refs/tags/UnitsNet.Modular/') && | |
| (github.event_name == 'push' || | |
| (github.event_name == 'workflow_dispatch' && inputs.publish_nuget)) | |
| environment: Publish | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Download NuGet packages | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: unitsnet-modular-packages-${{ github.sha }} | |
| path: nugets | |
| - name: Setup .NET SDK | |
| uses: actions/setup-dotnet@v6 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Log in to NuGet with trusted publishing | |
| uses: NuGet/login@v1 | |
| id: nuget-login | |
| with: | |
| user: angularsen | |
| - name: Push to nuget.org | |
| env: | |
| NUGET_API_KEY: ${{ steps.nuget-login.outputs.NUGET_API_KEY }} | |
| run: dotnet nuget push "**/*.nupkg" --skip-duplicate --api-key "$NUGET_API_KEY" --source https://api.nuget.org/v3/index.json | |
| working-directory: nugets |