uuid json converter supporting uuid as dictionary key (#15) #13
This file contains 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: Push to master | |
on: | |
push: | |
branches: | |
- "main" | |
jobs: | |
validate-version: | |
name: Validate package version | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.sha }} | |
- name: Validate version | |
shell: bash | |
run: | | |
version_prefix=$(cat ./src/Directory.Build.props | grep "<VersionPrefix>" | sed -e "s/ *<\/*VersionPrefix>//g") | |
version_suffix=$(cat ./src/Directory.Build.props | grep "<VersionSuffix>" | sed -e "s/ *<\/*VersionSuffix>//g") | |
echo "Package version prefix: $version_prefix" | |
echo "Package version suffix: $version_suffix" | |
if [ -z "${version_prefix// }" ]; then exit 1; fi | |
if [ -z "${version_suffix// }" ] && [ $prerelease == "true" ] | |
then | |
exit 1 | |
fi | |
version_with_suffix="${version_prefix}" | |
if [ ! -z "${version_suffix// }" ] | |
then | |
version_with_suffix="${version_prefix}-${version_suffix}" | |
fi | |
echo "validate_version_with_suffix=${version_with_suffix}" >> $GITHUB_ENV | |
echo "validate_version_suffix=${version_suffix}" >> $GITHUB_ENV | |
run-tests: | |
name: Run tests | |
needs: validate-version | |
runs-on: ubuntu-22.04 | |
if: ${{ !contains(github.event.commits[0].message, '[skip ci]') }} | |
env: | |
DOTNET_NOLOGO: true | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.sha }} | |
- name: Setup .NET Core SDK 6.0.413 | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.413 | |
- name: Setup .NET Core SDK 7.0.400 | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 7.0.400 | |
- name: Create coverage directory and promote absolute paths to env | |
shell: bash | |
run: | | |
mkdir coverage | |
PATH_TO_COVERAGE_DIRECTORY=$(realpath coverage) | |
echo "coverage_directory=${PATH_TO_COVERAGE_DIRECTORY}" >> $GITHUB_ENV | |
PATH_NET6_NOHW="${PATH_TO_COVERAGE_DIRECTORY}/cover_net6nohw" | |
echo "cover_net6_nohw=${PATH_NET6_NOHW}" >> $GITHUB_ENV | |
echo "cover_net6_nohw_merge=${PATH_NET6_NOHW}.net6.0.json" >> $GITHUB_ENV | |
PATH_NET6_HW="${PATH_TO_COVERAGE_DIRECTORY}/cover_net6hw" | |
echo "cover_net6_hw=${PATH_NET6_HW}" >> $GITHUB_ENV | |
echo "cover_net6_hw_merge=${PATH_NET6_HW}.net6.0.json" >> $GITHUB_ENV | |
PATH_NET7_NOHW="${PATH_TO_COVERAGE_DIRECTORY}/cover_net7nohw" | |
echo "cover_net7_nohw=${PATH_NET7_NOHW}" >> $GITHUB_ENV | |
echo "cover_net7_nohw_merge=${PATH_NET7_NOHW}.net7.0.json" >> $GITHUB_ENV | |
PATH_NET7_HW="${PATH_TO_COVERAGE_DIRECTORY}/cover_net7hw" | |
echo "cover_net7_hw=${PATH_NET7_HW}" >> $GITHUB_ENV | |
echo "cover_net7_hw_merge=${PATH_NET7_HW}.net7.0.info" >> $GITHUB_ENV | |
- name: Run .NET 6 tests without Hardware Intrinsics | |
shell: bash | |
run: | | |
export COMPlus_EnableHWIntrinsic=0 | |
export COMPlus_ReadyToRun=0 | |
export CollectCoverage=true | |
export CoverletOutputFormat=json | |
export CoverletOutput=${{ env.cover_net6_nohw }} | |
dotnet test -c Release ./src/Dodo.Primitives.Tests/Dodo.Primitives.Tests.csproj -f net6.0 | |
- name: Run .NET 6 tests with Hardware Intrinsics | |
shell: bash | |
run: | | |
export COMPlus_EnableHWIntrinsic=1 | |
unset COMPlus_ReadyToRun | |
export CollectCoverage=true | |
export CoverletOutputFormat=json | |
export CoverletOutput=${{ env.cover_net6_hw }} | |
export MergeWith=${{ env.cover_net6_nohw_merge }} | |
dotnet test -c Release ./src/Dodo.Primitives.Tests/Dodo.Primitives.Tests.csproj -f net6.0 | |
- name: Run .NET 7 tests without Hardware Intrinsics | |
shell: bash | |
run: | | |
export COMPlus_EnableHWIntrinsic=0 | |
export CollectCoverage=true | |
export CoverletOutputFormat=json | |
export CoverletOutput=${{ env.cover_net7_nohw }} | |
export MergeWith=${{ env.cover_net6_hw_merge }} | |
dotnet test -c Release ./src/Dodo.Primitives.Tests/Dodo.Primitives.Tests.csproj -f net7.0 | |
- name: Run .NET 7 tests with Hardware Intrinsics | |
shell: bash | |
run: | | |
export COMPlus_EnableHWIntrinsic=1 | |
export CollectCoverage=true | |
export CoverletOutputFormat=lcov | |
export CoverletOutput=${{ env.cover_net7_hw }} | |
export MergeWith=${{ env.cover_net7_nohw_merge }} | |
dotnet test -c Release ./src/Dodo.Primitives.Tests/Dodo.Primitives.Tests.csproj -f net7.0 | |
- name: Publish coverage report to coveralls.io | |
uses: coverallsapp/[email protected] | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: ${{ env.cover_net7_hw_merge }} | |
release: | |
name: Create release | |
runs-on: ubuntu-22.04 | |
needs: run-tests | |
if: ${{ !contains(github.event.commits[0].message, '[skip ci]') }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.sha }} | |
- name: Extract version | |
shell: bash | |
run: | | |
version_prefix=$(cat ./src/Directory.Build.props | grep "<VersionPrefix>" | sed -e "s/ *<\/*VersionPrefix>//g") | |
version_suffix=$(cat ./src/Directory.Build.props | grep "<VersionSuffix>" | sed -e "s/ *<\/*VersionSuffix>//g") | |
echo "Package version prefix: $version_prefix" | |
echo "Package version suffix: $version_suffix" | |
if [ -z "${version_prefix// }" ]; then exit 1; fi | |
version_with_suffix="${version_prefix}" | |
has_suffix="false" | |
if [ ! -z "${version_suffix// }" ] | |
then | |
version_with_suffix="${version_prefix}-${version_suffix}" | |
has_suffix="true" | |
fi | |
echo "release_version_with_suffix=${version_with_suffix}" >> $GITHUB_ENV | |
echo "release_has_suffix=${has_suffix}" >> $GITHUB_ENV | |
- name: Create release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.release_version_with_suffix }} | |
release_name: Release ${{ env.release_version_with_suffix }} | |
draft: true | |
prerelease: ${{ env.release_has_suffix }} | |