Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.net 5 support #187

Merged
merged 37 commits into from
Aug 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
77cba3f
Multi target frameworks support, many nullable warnings and errors re…
egil Aug 12, 2020
dd8af6c
updated build script
egil Aug 12, 2020
96bd17d
Update .github/workflows/CI-PR.yml
egil Aug 12, 2020
d9a5054
Update .github/workflows/CI-PR.yml
egil Aug 12, 2020
3f7880e
updated build script
egil Aug 12, 2020
c2f2467
updated build script
egil Aug 12, 2020
1a1bdfb
updated build script
egil Aug 12, 2020
3a5474b
updated build script 2
egil Aug 12, 2020
397045e
updated nerdbank gitversioning in bunit.csproj
egil Aug 12, 2020
fe2f47a
update to template build params
egil Aug 12, 2020
03eea20
update to template build
egil Aug 12, 2020
532384a
update to template build
egil Aug 12, 2020
00d496e
update to template install
egil Aug 12, 2020
a8944f9
update to version setting
egil Aug 12, 2020
a04acda
workflow cleanup
egil Aug 12, 2020
38b1a8b
new pr checks
egil Aug 13, 2020
dc0b068
update to pr
egil Aug 13, 2020
dd12e61
update to checkout depth
egil Aug 13, 2020
c040c7e
update to step order
egil Aug 13, 2020
0cf794e
added test step
egil Aug 13, 2020
68398fc
run dotnet format manually
egil Aug 13, 2020
f99a4d9
run dotnet format commit changes
egil Aug 13, 2020
00a81c7
run dotnet format commit changes
egil Aug 13, 2020
8a38772
run dotnet format commit changes
egil Aug 13, 2020
be85bb2
tweaks
egil Aug 13, 2020
97a8f47
tweaks 2
egil Aug 13, 2020
84c0e3d
Automated dotnet-format update
actions-user Aug 13, 2020
aad8e09
workflow reorg
egil Aug 13, 2020
084305b
added missing checkout depth
egil Aug 13, 2020
f2dbf11
added coveralls
egil Aug 13, 2020
3ff2f5a
tweaks to coveralls upload
egil Aug 13, 2020
32df836
exclude assets from coverage
egil Aug 13, 2020
0162f07
exclude assets from coverage
egil Aug 13, 2020
ffef035
Automated dotnet-format update
actions-user Aug 13, 2020
c74aa80
coveralls version
egil Aug 13, 2020
c65db7b
coveralls version
egil Aug 13, 2020
7dc0ac8
added changed to changelog
egil Aug 13, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
queries:
- uses: security-and-quality

paths:
- src
62 changes: 0 additions & 62 deletions .github/workflows/CI-PR.yml

This file was deleted.

62 changes: 0 additions & 62 deletions .github/workflows/CI.yml

This file was deleted.

58 changes: 58 additions & 0 deletions .github/workflows/codeql.yml
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Deploy Docs
name: "Build and Deploy Docs"

on:
push:
Expand All @@ -15,34 +15,49 @@ jobs:
- 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
run: echo "::set-env name=VERSION::$NBGV_NuGetPackageVersion"

- name: Update tokens in project files
uses: cschleiden/replace-tokens@v1
with:
files: '["docs/site/*.md", "docs/**/*.md", "docs/**/*.tmpl.partial", "*.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/ --no-restore -p:version=$VERSION
dotnet build src/bunit.web/ --no-restore -p:version=$VERSION
dotnet build src/bunit.xunit/ --no-restore -p:version=$VERSION
$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 -p:version=$VERSION

- name: Verfiy docs samples
run: |
dotnet test docs/samples/tests/mstest
dotnet test docs/samples/tests/nunit
dotnet test docs/samples/tests/razor
dotnet test docs/samples/tests/xunit
run: dotnet test docs/samples

- name: Building docs
run: |
dotnet build docs/site/
dotnet build docs/site/

- name: Deploy to GitHub Pages
if: success()
uses: crazy-max/ghaction-github-pages@v2
Expand Down
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:
Expand All @@ -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
Expand All @@ -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/github-action@v1.1.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: src/bunit.core.tests/coverage/coverage.net5.0.info
parallel: true
- uses: coverallsapp/github-action@v1.1.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: src/bunit.core.tests/coverage/coverage.netcoreapp3.1.info
parallel: true

- uses: coverallsapp/github-action@v1.1.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: src/bunit.web.tests/coverage/coverage.net5.0.info
parallel: true
- uses: coverallsapp/github-action@v1.1.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: src/bunit.web.tests/coverage/coverage.netcoreapp3.1.info
parallel: true

- uses: coverallsapp/github-action@v1.1.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: src/bunit.xunit.tests/coverage/coverage.net5.0.info
parallel: true
- uses: coverallsapp/github-action@v1.1.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: src/bunit.xunit.tests/coverage/coverage.netcoreapp3.1.info
parallel: true

- uses: coverallsapp/github-action@v1.1.1
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true

- name: Push packages to GitHub Package Registry
run: |
for f in ${GITHUB_WORKSPACE}/packages/*.nupkg
Expand Down
Loading