Skip to content

Commit

Permalink
Add .NET 8, Drop .NET 7 (#17)
Browse files Browse the repository at this point in the history
* .NET 8 support
* Update BDN
* Fix pipeline
* Use Codecov instead of coveralls
  • Loading branch information
vanbukin authored Jan 12, 2024
1 parent c78f9f3 commit bb22827
Show file tree
Hide file tree
Showing 18 changed files with 1,136 additions and 732 deletions.
2 changes: 1 addition & 1 deletion .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ representative at an online or offline event.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at [email protected].
reported to the community leaders responsible for enforcement at [email protected].
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
Expand Down
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ This project has adopted the [Code of Conduct](./CODE_OF_CONDUCT.md).

## NuGet package release process for repository owners and collaborators

You can find latest releases on the [releases pane](https://github.com/dodopizza/primitives/releases) or NuGet repository.
You can find latest releases on the [releases pane](https://github.com/dodobrands/primitives/releases) or NuGet repository.
Binary file modified .github/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 0 additions & 41 deletions .github/workflows/codeql.yml

This file was deleted.

78 changes: 44 additions & 34 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ on:
jobs:
compare-version:
name: Compare versions in current branch and main
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
if: ${{ !contains(github.event.commits[0].message, '[skip ci]') }}
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
steps:
- name: Checkout source branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
- name: Get source branch version
Expand All @@ -34,7 +34,7 @@ jobs:
echo "version_with_suffix_src=${version_with_suffix}" >> $GITHUB_ENV
echo "has_suffix_src=${has_suffix}" >> $GITHUB_ENV
- name: Checkout target branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.base_ref }}
- name: Get target branch version
Expand All @@ -54,12 +54,12 @@ jobs:
fi
echo "version_with_suffix_dst=${version_with_suffix}" >> $GITHUB_ENV
echo "has_suffix_dst=${has_suffix}" >> $GITHUB_ENV
- name: Setup .NET Core SDK 7.0.400
uses: actions/setup-dotnet@v3
- name: Setup .NET Core SDK 8.0.101
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.400
dotnet-version: 8.0.101
- name: Checkout source branch back
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
- name: Compare versions
Expand All @@ -69,7 +69,7 @@ jobs:
shell: bash
run: |
dotnet publish -c Release ./tools/Dodo.Primitives.Tools.CompareVersions/Dodo.Primitives.Tools.CompareVersions.csproj
source_more_than_target=$(dotnet ./tools/Dodo.Primitives.Tools.CompareVersions/bin/Release/net7.0/publish/Dodo.Primitives.Tools.CompareVersions.dll "${source_version}" "${target_version}")
source_more_than_target=$(dotnet ./tools/Dodo.Primitives.Tools.CompareVersions/bin/Release/net8.0/publish/Dodo.Primitives.Tools.CompareVersions.dll "${source_version}" "${target_version}")
last_exit_code=$(printf "%d" $?)
source_more_than_target=$(printf "%s" $source_more_than_target)
if [ "$last_exit_code" -ne 0 ]
Expand Down Expand Up @@ -97,24 +97,24 @@ jobs:
run-tests:
name: Run tests
needs: compare-version
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
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
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
- name: Setup .NET Core SDK 6.0.413
uses: actions/setup-dotnet@v3
- name: Setup .NET Core SDK 6.0.418
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.413
- name: Setup .NET Core SDK 7.0.400
uses: actions/setup-dotnet@v3
dotnet-version: 6.0.418
- name: Setup .NET Core SDK 8.0.101
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.400
dotnet-version: 8.0.101
- name: Create coverage directory and promote absolute paths to env
shell: bash
run: |
Expand All @@ -130,18 +130,20 @@ jobs:
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_NET8_NOHW="${PATH_TO_COVERAGE_DIRECTORY}/cover_net8nohw"
echo "cover_net8_nohw=${PATH_NET8_NOHW}" >> $GITHUB_ENV
echo "cover_net8_nohw_merge=${PATH_NET8_NOHW}.net8.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
PATH_NET8_HW="${PATH_TO_COVERAGE_DIRECTORY}/cover_net8hw"
echo "cover_net8_hw=${PATH_NET8_HW}" >> $GITHUB_ENV
echo "cover_net8_hw_merge=${PATH_NET8_HW}.net8.0.info" >> $GITHUB_ENV
- name: Run .NET 6 tests without Hardware Intrinsics
shell: bash
run: |
export COMPlus_EnableHWIntrinsic=0
export DOTNET_EnableHWIntrinsic=0
export COMPlus_ReadyToRun=0
export DOTNET_ReadyToRun=0
export CollectCoverage=true
export CoverletOutputFormat=json
export CoverletOutput=${{ env.cover_net6_nohw }}
Expand All @@ -150,33 +152,41 @@ jobs:
shell: bash
run: |
export COMPlus_EnableHWIntrinsic=1
export DOTNET_EnableHWIntrinsic=1
unset COMPlus_ReadyToRun
unset DOTNET_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
- name: Run .NET 8 tests without Hardware Intrinsics
shell: bash
run: |
export COMPlus_EnableHWIntrinsic=0
export DOTNET_EnableHWIntrinsic=0
export COMPlus_ReadyToRun=0
export DOTNET_ReadyToRun=0
export CollectCoverage=true
export CoverletOutputFormat=json
export CoverletOutput=${{ env.cover_net7_nohw }}
export CoverletOutput=${{ env.cover_net8_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
dotnet test -c Release ./src/Dodo.Primitives.Tests/Dodo.Primitives.Tests.csproj -f net8.0
- name: Run .NET 8 tests with Hardware Intrinsics
shell: bash
run: |
export COMPlus_EnableHWIntrinsic=1
export DOTNET_EnableHWIntrinsic=1
unset COMPlus_ReadyToRun
unset DOTNET_ReadyToRun
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]
export CoverletOutput=${{ env.cover_net8_hw }}
export MergeWith=${{ env.cover_net8_nohw_merge }}
dotnet test -c Release ./src/Dodo.Primitives.Tests/Dodo.Primitives.Tests.csproj -f net8.0
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ${{ env.cover_net7_hw_merge }}

files: ${{ env.cover_net8_hw_merge }}
73 changes: 42 additions & 31 deletions .github/workflows/push_to_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ on:
jobs:
validate-version:
name: Validate package version
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
- name: Validate version
Expand All @@ -34,24 +34,24 @@ jobs:
run-tests:
name: Run tests
needs: validate-version
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
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
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
- name: Setup .NET Core SDK 6.0.413
uses: actions/setup-dotnet@v3
- name: Setup .NET Core SDK 6.0.418
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.413
- name: Setup .NET Core SDK 7.0.400
uses: actions/setup-dotnet@v3
dotnet-version: 6.0.418
- name: Setup .NET Core SDK 8.0.101
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.400
dotnet-version: 8.0.101
- name: Create coverage directory and promote absolute paths to env
shell: bash
run: |
Expand All @@ -67,18 +67,20 @@ jobs:
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_NET8_NOHW="${PATH_TO_COVERAGE_DIRECTORY}/cover_net8nohw"
echo "cover_net8_nohw=${PATH_NET8_NOHW}" >> $GITHUB_ENV
echo "cover_net8_nohw_merge=${PATH_NET8_NOHW}.net8.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
PATH_NET8_HW="${PATH_TO_COVERAGE_DIRECTORY}/cover_net8hw"
echo "cover_net8_hw=${PATH_NET8_HW}" >> $GITHUB_ENV
echo "cover_net8_hw_merge=${PATH_NET8_HW}.net8.0.info" >> $GITHUB_ENV
- name: Run .NET 6 tests without Hardware Intrinsics
shell: bash
run: |
export COMPlus_EnableHWIntrinsic=0
export DOTNET_EnableHWIntrinsic=0
export COMPlus_ReadyToRun=0
export DOTNET_ReadyToRun=0
export CollectCoverage=true
export CoverletOutputFormat=json
export CoverletOutput=${{ env.cover_net6_nohw }}
Expand All @@ -87,43 +89,52 @@ jobs:
shell: bash
run: |
export COMPlus_EnableHWIntrinsic=1
export DOTNET_EnableHWIntrinsic=1
unset COMPlus_ReadyToRun
unset DOTNET_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
- name: Run .NET 8 tests without Hardware Intrinsics
shell: bash
run: |
export COMPlus_EnableHWIntrinsic=0
export DOTNET_EnableHWIntrinsic=0
export COMPlus_ReadyToRun=0
export DOTNET_ReadyToRun=0
export CollectCoverage=true
export CoverletOutputFormat=json
export CoverletOutput=${{ env.cover_net7_nohw }}
export CoverletOutput=${{ env.cover_net8_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
dotnet test -c Release ./src/Dodo.Primitives.Tests/Dodo.Primitives.Tests.csproj -f net8.0
- name: Run .NET 8 tests with Hardware Intrinsics
shell: bash
run: |
export COMPlus_EnableHWIntrinsic=1
export DOTNET_EnableHWIntrinsic=1
unset COMPlus_ReadyToRun
unset DOTNET_ReadyToRun
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]
export CoverletOutput=${{ env.cover_net8_hw }}
export MergeWith=${{ env.cover_net8_nohw_merge }}
dotnet test -c Release ./src/Dodo.Primitives.Tests/Dodo.Primitives.Tests.csproj -f net8.0
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ${{ env.cover_net7_hw_merge }}
files: ${{ env.cover_net8_hw_merge }}
release:
name: Create release
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
needs: run-tests
if: ${{ !contains(github.event.commits[0].message, '[skip ci]') }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
- name: Extract version
Expand All @@ -144,11 +155,11 @@ jobs:
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
uses: ncipollo/release-action@v1.13.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.release_version_with_suffix }}
tag: ${{ env.release_version_with_suffix }}
release_name: Release ${{ env.release_version_with_suffix }}
draft: true
prerelease: ${{ env.release_has_suffix }}
Expand Down
Loading

0 comments on commit bb22827

Please sign in to comment.