-
-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enabled multi-targeting of both .net 5 and .net standard 2.1
* Multi target frameworks support, many nullable warnings and errors removed * updated build script * Update .github/workflows/CI-PR.yml * Update .github/workflows/CI-PR.yml * updated build script * updated build script * updated build script * updated build script 2 * updated nerdbank gitversioning in bunit.csproj * update to template build params * update to template build * update to template build * update to template install * update to version setting * workflow cleanup * new pr checks * update to pr * update to checkout depth * update to step order * added test step * run dotnet format manually * run dotnet format commit changes * run dotnet format commit changes * run dotnet format commit changes * tweaks * tweaks 2 * Automated dotnet-format update * workflow reorg * added missing checkout depth * added coveralls * tweaks to coveralls upload * exclude assets from coverage * exclude assets from coverage * Automated dotnet-format update * coveralls version * coveralls version * added changed to changelog Co-authored-by: Github Actions <[email protected]>
- Loading branch information
1 parent
d376013
commit ea45498
Showing
80 changed files
with
798 additions
and
500 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
queries: | ||
- uses: security-and-quality | ||
|
||
paths: | ||
- src |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: "CodeQL Scanning" | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
- main | ||
paths: | ||
- 'src/**' | ||
schedule: | ||
- cron: '0 0 * * 0' | ||
|
||
jobs: | ||
code-scan: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
# We must fetch at least the immediate parents so that if this is | ||
# a pull request then we can checkout the head. | ||
fetch-depth: 0 | ||
|
||
# If this run was triggered by a pull request event, then checkout | ||
# the head of the pull request instead of the merge commit. | ||
- run: git checkout HEAD^2 | ||
if: ${{ github.event_name == 'pull_request' }} | ||
|
||
- uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '3.1.x' | ||
- uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '5.0.100-preview.7.20366.6' | ||
- name: Move .net SDK's to shared folder (hack) | ||
shell: pwsh | ||
run: | | ||
$version = Split-Path (Split-Path $ENV:DOTNET_ROOT -Parent) -Leaf; | ||
$root = Split-Path (Split-Path $ENV:DOTNET_ROOT -Parent) -Parent; | ||
$directories = Get-ChildItem $root | Where-Object { $_.Name -ne $version }; | ||
foreach ($dir in $directories) { | ||
$from = $dir.FullName; | ||
$to = "$root/$version"; | ||
Write-Host Copying from $from to $to; | ||
Copy-Item "$from\*" $to -Recurse -Force; | ||
} | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v1 | ||
with: | ||
languages: csharp | ||
config-file: ./.github/codeql/codeql-config.yml | ||
|
||
- name: Building library | ||
run: dotnet build src -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v1 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: DEV-GPR-PUSH | ||
name: Push nightly to GPR | ||
|
||
on: | ||
push: | ||
|
@@ -8,51 +8,67 @@ on: | |
- 'src/bunit.core/**' | ||
- 'src/bunit.web/**' | ||
- 'src/bunit.xunit/**' | ||
- 'src/bunit.template/**' | ||
|
||
env: | ||
VERSION: '' | ||
BRANCH: '' | ||
|
||
jobs: | ||
build: | ||
name: Build and verify library | ||
push-to-gpr: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # avoid shallow clone so nbgv can do its work. | ||
|
||
- uses: dotnet/nbgv@master | ||
with: | ||
setAllVars: true | ||
|
||
- name: Setting VERSION and BRANCH env | ||
run: | | ||
echo "::set-env name=VERSION::$NBGV_NuGetPackageVersion" | ||
echo "::set-env name=BRANCH::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')" | ||
- name: Update tokens in project files | ||
uses: cschleiden/replace-tokens@v1 | ||
with: | ||
files: '["*.csproj", "**/*.csproj"]' | ||
|
||
- uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '3.1.202' | ||
- name: Building library | ||
dotnet-version: '3.1.x' | ||
- uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '5.0.100-preview.7.20366.6' | ||
- name: DOTNET HACK | ||
shell: pwsh | ||
run: | | ||
dotnet restore src | ||
dotnet build src/bunit.core/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true | ||
dotnet build src/bunit.web/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true | ||
dotnet build src/bunit.xunit/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true | ||
dotnet build src/bunit.testassets/ -c Release --no-restore | ||
$version = Split-Path (Split-Path $ENV:DOTNET_ROOT -Parent) -Leaf; | ||
$root = Split-Path (Split-Path $ENV:DOTNET_ROOT -Parent) -Parent; | ||
$directories = Get-ChildItem $root | Where-Object { $_.Name -ne $version }; | ||
foreach ($dir in $directories) { | ||
$from = $dir.FullName; | ||
$to = "$root/$version"; | ||
Write-Host Copying from $from to $to; | ||
Copy-Item "$from\*" $to -Recurse -Force; | ||
} | ||
- name: Building library | ||
run: dotnet build src -c Release -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true | ||
|
||
- name: Running unit tests | ||
run: | | ||
dotnet test src/bunit.core.tests/ -c Release --no-restore --verbosity normal /nowarn:CS1591 | ||
dotnet test src/bunit.web.tests/ -c Release --no-restore --verbosity normal /nowarn:CS1591 | ||
dotnet test src/bunit.xunit.tests/ -c Release --no-restore --verbosity normal /nowarn:CS1591 | ||
run: dotnet test src --verbosity normal /nowarn:CS1591 /p:CollectCoverage=true /p:CoverletOutput=./coverage/ /p:CoverletOutputFormat=lcov | ||
|
||
- name: Creating library package | ||
run: | | ||
dotnet pack src/bunit.core/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true | ||
dotnet pack src/bunit.web/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true | ||
dotnet pack src/bunit.xunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true | ||
dotnet pack src/bunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true | ||
- name: Buidling template package | ||
run: dotnet pack src/bunit.template/ -c Release -o ${GITHUB_WORKSPACE}/packages | ||
- name: Verifying template | ||
|
@@ -61,6 +77,45 @@ jobs: | |
dotnet new bunit --no-restore -o ${GITHUB_WORKSPACE}/Test | ||
dotnet restore ${GITHUB_WORKSPACE}/Test/Test.csproj --source ${GITHUB_WORKSPACE}/packages | ||
dotnet test ${GITHUB_WORKSPACE}/Test | ||
- uses: coverallsapp/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
path-to-lcov: src/bunit.core.tests/coverage/coverage.net5.0.info | ||
parallel: true | ||
- uses: coverallsapp/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
path-to-lcov: src/bunit.core.tests/coverage/coverage.netcoreapp3.1.info | ||
parallel: true | ||
|
||
- uses: coverallsapp/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
path-to-lcov: src/bunit.web.tests/coverage/coverage.net5.0.info | ||
parallel: true | ||
- uses: coverallsapp/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
path-to-lcov: src/bunit.web.tests/coverage/coverage.netcoreapp3.1.info | ||
parallel: true | ||
|
||
- uses: coverallsapp/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
path-to-lcov: src/bunit.xunit.tests/coverage/coverage.net5.0.info | ||
parallel: true | ||
- uses: coverallsapp/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
path-to-lcov: src/bunit.xunit.tests/coverage/coverage.netcoreapp3.1.info | ||
parallel: true | ||
|
||
- uses: coverallsapp/[email protected] | ||
with: | ||
github-token: ${{ secrets.github_token }} | ||
parallel-finished: true | ||
|
||
- name: Push packages to GitHub Package Registry | ||
run: | | ||
for f in ${GITHUB_WORKSPACE}/packages/*.nupkg | ||
|
Oops, something went wrong.