diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ee9fb34..358c9944 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,9 @@ name: Build with Tests -on: [push] +on: + push: + pull_request: + types: [opened, edited] jobs: build_and_test_Windows: @@ -13,6 +16,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Build run: | @@ -38,12 +43,6 @@ jobs: distribution: 'temurin' # See 'Supported distributions' for available options java-version: '17' - - name: Set JAVA_HOME to JDK 17 - shell: pwsh - run: | - $jdkPath = $env:JAVA_HOME_17_X64 - echo "JAVA_HOME=$jdkPath" >> $GITHUB_ENV - - name: Install dotnet tools run: | dotnet tool install --global dotnet-sonarscanner diff --git a/Generate-ReleaseNotes.bat b/Generate-ReleaseNotes.bat index 21da30d5..bbfc4e61 100644 --- a/Generate-ReleaseNotes.bat +++ b/Generate-ReleaseNotes.bat @@ -2,4 +2,4 @@ rem https://github.com/StefH/GitHubReleaseNotes SET version=v1.4.1 -GitHubReleaseNotes --output CHANGELOG.md --exclude-labels invalid question documentation wontfix --language en --version %version% --token %GH_TOKEN% +GitHubReleaseNotes --output CHANGELOG.md --exclude-labels invalid question documentation wontfix environment --language en --version %version% --token %GH_TOKEN% diff --git a/System.Linq.Dynamic.Core.sln b/System.Linq.Dynamic.Core.sln index d7fb1752..1615cd0b 100644 --- a/System.Linq.Dynamic.Core.sln +++ b/System.Linq.Dynamic.Core.sln @@ -17,7 +17,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ProjectSection(SolutionItems) = preProject .deployment = .deployment .editorconfig = .editorconfig - azure-pipelines.yml = azure-pipelines.yml CHANGELOG.md = CHANGELOG.md Directory.Build.props = Directory.Build.props Generate-ReleaseNotes.bat = Generate-ReleaseNotes.bat @@ -132,9 +131,6 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleApp_net6.0_EF6_Sqlite", "src-console\ConsoleAppEF6_Sqlite\ConsoleApp_net6.0_EF6_Sqlite.csproj", "{CA03FD55-9DAB-4827-9A35-A96D3804B311}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src-examples", "src-examples", "{BCA2A024-9032-4E56-A6C4-17A15D921728}" - ProjectSection(SolutionItems) = preProject - src-examples\README.md = src-examples\README.md - EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeFirst.DataAccess", "src-examples\CodeFirst.DataAccess\CodeFirst.DataAccess.csproj", "{E36D1A08-F3ED-48C7-9DBF-8F625974A6C4}" EndProject diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index d22d1283..00000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,96 +0,0 @@ -pool: - vmImage: 'windows-2019' - -variables: - Prerelease: 'ci' - buildType: 'azure-pipelines-ci' - buildId: "1$(Build.BuildId)" - buildProjects: '**/src/**/+(System.Linq.Dynamic.Core|EntityFramework.DynamicLinq|Microsoft.EntityFrameworkCore.DynamicLinq|Z.EntityFramework.Classic.DynamicLinq).csproj' - -steps: -# Print buildId -- script: | - echo "BuildId = $(buildId)" - displayName: 'Print buildId' - -# Install SonarScanner -- script: | - dotnet tool install --global dotnet-sonarscanner - condition: and(succeeded(), eq(variables['SonarScanner'], 'yes')) - displayName: Install SonarScanner - -# Begin SonarScanner -# See also -# - https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools, else you get this error: `Since you just installed the .NET Core SDK, you will need to reopen the Command Prompt window before running the tool you installed.` -# - https://github.com/dotnet/cli/issues/8368 -# - https://github.com/Microsoft/vsts-tasks/issues/8291 -# -- script: | - %USERPROFILE%\.dotnet\tools\dotnet-sonarscanner begin /k:"system.linq.dynamic.core" /o:"stefh-github" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /v:"$(buildId)" /d:sonar.cs.opencover.reportsPaths="**\coverage.netcoreapp2.1.opencover.xml" - condition: and(succeeded(), eq(variables['SonarScanner'], 'yes')) - displayName: Begin SonarScanner - -- task: DotNetCoreCLI@2 - displayName: Build Projects in Debug configuration - inputs: - command: 'build' - arguments: /p:Configuration=Debug # https://github.com/MicrosoftDocs/vsts-docs/issues/1976 - projects: $(buildProjects) - - -# Build tests and run tests for net452 and netcoreapp2.1 (with coverage) -- script: | - dotnet build ./test/System.Linq.Dynamic.Core.Tests/System.Linq.Dynamic.Core.Tests.csproj --configuration Debug - dotnet test ./test/System.Linq.Dynamic.Core.Tests/System.Linq.Dynamic.Core.Tests.csproj --no-build --configuration Debug --framework net452 - dotnet test ./test/System.Linq.Dynamic.Core.Tests/System.Linq.Dynamic.Core.Tests.csproj --no-build --configuration Debug --framework netcoreapp2.1 --logger trx /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - displayName: 'Build tests and run tests for net452 and netcoreapp2.1 (with coverage)' - -# End SonarScanner -- script: | - %USERPROFILE%\.dotnet\tools\dotnet-sonarscanner end /d:sonar.login="$(SONAR_TOKEN)" - condition: and(succeeded(), eq(variables['SonarScanner'], 'yes')) - displayName: End SonarScanner - -# Upload coverage to codecov.io -- script: | - %USERPROFILE%\.nuget\packages\codecov\1.10.0\tools\codecov.exe -f "./test/System.Linq.Dynamic.Core.Tests/coverage.netcoreapp2.1.opencover.xml" -t $(CODECOV_TOKEN) - displayName: Upload coverage to codecov.io - -- task: PublishTestResults@2 - inputs: - testRunner: VSTest - testResultsFiles: '**/*.trx' - -# Based on https://whereslou.com/2018/09/versioning-and-publishing-nuget-packages-automatically-using-azure-devops-pipelines/ -- task: DotNetCoreCLI@2 - displayName: Build Projects in Release configuration - inputs: - command: 'build' - arguments: /p:Configuration=Release # https://github.com/MicrosoftDocs/vsts-docs/issues/1976 - projects: $(buildProjects) - -- task: DotNetCoreCLI@2 - displayName: Pack - condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) # Do not run for PullRequests - inputs: - command: pack - configuration: 'Release' - packagesToPack: $(buildProjects) - nobuild: true - packDirectory: '$(Build.ArtifactStagingDirectory)/packages' - verbosityPack: 'normal' - -- task: PublishBuildArtifacts@1 - displayName: Publish Artifacts - condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) # Do not run for PullRequests - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)' - -# -n true --> https://github.com/NuGet/Home/issues/8148 -- task: DotNetCoreCLI@2 - displayName: Push to MyGet - condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) # Do not run for PullRequests - inputs: - command: custom - custom: nuget - arguments: push $(Build.ArtifactStagingDirectory)\packages\*.nupkg -n true -s https://www.myget.org/F/system-linq-dynamic-core/api/v3/index.json --no-service-endpoint --api-key $(MyGetKey)