Skip to content

Commit ffbc120

Browse files
authored
Merge pull request #1 from egil/dev
Getting latest changes for docs from egil/bUnit dev branch.
2 parents 8742dfd + 89c9dcf commit ffbc120

File tree

143 files changed

+3695
-450
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+3695
-450
lines changed

.github/pull_request_template.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## Pull request description
2+
<!---
3+
Describe the changes here and motiviations behind them, if it is not obvious
4+
from the related issues. Does it have new features, breaking changes, etc.
5+
-->
6+
7+
### PR meta checklist
8+
- [ ] Pull request is targeting at `DEV` branch.
9+
- [ ] Pull request is linked to all related issues, if any.
10+
- [ ] I have read the _CONTRIBUTING.md_ document.
11+
12+
### Content checklist
13+
- [ ] My code follows the code style of this project and AspNetCore coding guidelines.
14+
- [ ] My change requires a change to the documentation.
15+
- [ ] I have updated the documentation accordingly.
16+
- [ ] I have updated the appropriate sub section in the _CHANGELOG.md_.
17+
- [ ] I have added, updated or removed tests to according to my changes.
18+
- [ ] All tests passed.

.github/workflows/CI-CD-Docs.yml

+24-22
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,51 @@ name: Build and Deploy Docs
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
paths-ignore:
88
- '!docs/**'
9-
- '.github/**'
10-
11-
env:
12-
VERSION: '1.0.0-beta-7'
13-
BRANCH: 'master'
14-
COMMIT: ''
15-
DOCFX_SOURCE_BRANCH_NAME: 'master'
9+
- '!.github/**'
1610

1711
jobs:
1812
build:
19-
runs-on: ubuntu-latest
13+
runs-on: windows-latest
2014
steps:
2115
- uses: actions/checkout@v2
2216
with:
2317
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
2418
- uses: dotnet/nbgv@master
2519
with:
2620
setAllVars: true
27-
- name: Setting VERSION and BRANCH env
28-
run: |
29-
echo "::set-env name=VERSION::$NBGV_NuGetPackageVersion"
30-
echo "::set-env name=BRANCH::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')"
21+
- name: Setting VERSION
22+
run: echo "::set-env name=VERSION::$NBGV_NuGetPackageVersion"
3123
- name: Update tokens in project files
3224
uses: cschleiden/replace-tokens@v1
3325
with:
34-
files: '["docs/*.md", "docs/**/*.md", "*.csproj", "**/*.csproj"]'
26+
files: '["docs/site/*.md", "docs/**/*.md", "docs/**/*.tmpl.partial", "*.csproj", "**/*.csproj"]'
3527
- uses: actions/setup-dotnet@v1
3628
with:
3729
dotnet-version: '3.1.202'
38-
- name: Building library and docs
30+
- name: Building library
3931
run: |
4032
dotnet restore src
4133
dotnet build src/bunit.core/ --no-restore -p:version=$VERSION
4234
dotnet build src/bunit.web/ --no-restore -p:version=$VERSION
4335
dotnet build src/bunit.xunit/ --no-restore -p:version=$VERSION
44-
dotnet build docs/docs.csproj
45-
- name: Deploy
46-
uses: JamesIves/github-pages-deploy-action@releases/v3
36+
- name: Verfiy docs samples
37+
run: |
38+
dotnet test docs/samples/tests/mstest
39+
dotnet test docs/samples/tests/nunit
40+
dotnet test docs/samples/tests/razor
41+
dotnet test docs/samples/tests/xunit
42+
- name: Building docs
43+
run: |
44+
dotnet build docs/site/
45+
dotnet build docs/site/
46+
- name: Deploy to GitHub Pages
47+
if: success()
48+
uses: crazy-max/ghaction-github-pages@v2
4749
with:
48-
ACCESS_TOKEN: ${{ secrets.GH_DOCS }}
49-
BRANCH: gh-pages # The branch the action should deploy to.
50-
FOLDER: docs/_site # The folder the action should deploy.
51-
CLEAN: true
50+
target_branch: gh-pages
51+
build_dir: docs/site/_site
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/CI.yml

+1-10
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,4 @@ jobs:
5959
dotnet new --install ${GITHUB_WORKSPACE}/packages/bunit.template.$VERSION.nupkg
6060
dotnet new bunit --no-restore -o ${GITHUB_WORKSPACE}/Test
6161
dotnet restore ${GITHUB_WORKSPACE}/Test/Test.csproj --source ${GITHUB_WORKSPACE}/packages
62-
dotnet test ${GITHUB_WORKSPACE}/Test
63-
- name: Push packages to GitHub Package Registry
64-
run: |
65-
for f in ${GITHUB_WORKSPACE}/packages/*.nupkg
66-
do
67-
curl -vX PUT -u "egil:${{ secrets.GITHUB_TOKEN }}" -F package=@$f https://nuget.pkg.github.com/egil/
68-
done
69-
shell: bash
70-
# - name: Push packages to GitHub Package Registry
71-
# run: dotnet nuget push ${GITHUB_WORKSPACE}/packages/'*.nupkg' --skip-duplicate
62+
dotnet test ${GITHUB_WORKSPACE}/Test

.github/workflows/DEV-GPR-PUSH.yml

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: DEV-GPR-PUSH
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
paths:
8+
- 'src/bunit.core/**'
9+
- 'src/bunit.web/**'
10+
- 'src/bunit.xunit/**'
11+
12+
env:
13+
VERSION: ''
14+
BRANCH: ''
15+
16+
jobs:
17+
build:
18+
name: Build and verify library
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v2
22+
with:
23+
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
24+
- uses: dotnet/nbgv@master
25+
with:
26+
setAllVars: true
27+
- name: Setting VERSION and BRANCH env
28+
run: |
29+
echo "::set-env name=VERSION::$NBGV_NuGetPackageVersion"
30+
echo "::set-env name=BRANCH::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')"
31+
- name: Update tokens in project files
32+
uses: cschleiden/replace-tokens@v1
33+
with:
34+
files: '["*.csproj", "**/*.csproj"]'
35+
- uses: actions/setup-dotnet@v1
36+
with:
37+
dotnet-version: '3.1.202'
38+
- name: Building library
39+
run: |
40+
dotnet restore src
41+
dotnet build src/bunit.core/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
42+
dotnet build src/bunit.web/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
43+
dotnet build src/bunit.xunit/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
44+
dotnet build src/bunit.testassets/ -c Release --no-restore
45+
- name: Running unit tests
46+
run: |
47+
dotnet test src/bunit.core.tests/ -c Release --no-restore --verbosity normal /nowarn:CS1591
48+
dotnet test src/bunit.web.tests/ -c Release --no-restore --verbosity normal /nowarn:CS1591
49+
dotnet test src/bunit.xunit.tests/ -c Release --no-restore --verbosity normal /nowarn:CS1591
50+
- name: Creating library package
51+
run: |
52+
dotnet pack src/bunit.core/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
53+
dotnet pack src/bunit.web/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
54+
dotnet pack src/bunit.xunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
55+
dotnet pack src/bunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
56+
- name: Buidling template package
57+
run: dotnet pack src/bunit.template/ -c Release -o ${GITHUB_WORKSPACE}/packages
58+
- name: Verifying template
59+
run: |
60+
dotnet new --install ${GITHUB_WORKSPACE}/packages/bunit.template.$VERSION.nupkg
61+
dotnet new bunit --no-restore -o ${GITHUB_WORKSPACE}/Test
62+
dotnet restore ${GITHUB_WORKSPACE}/Test/Test.csproj --source ${GITHUB_WORKSPACE}/packages
63+
dotnet test ${GITHUB_WORKSPACE}/Test
64+
- name: Push packages to GitHub Package Registry
65+
run: |
66+
for f in ${GITHUB_WORKSPACE}/packages/*.nupkg
67+
do
68+
curl -vX PUT -u "egil:${{ secrets.GITHUB_TOKEN }}" -F package=@$f https://nuget.pkg.github.com/egil/
69+
done
70+
shell: bash
71+
# - name: Push packages to GitHub Package Registry
72+
# run: dotnet nuget push ${GITHUB_WORKSPACE}/packages/'*.nupkg' --skip-duplicate

.github/workflows/NUGET-PUSH.yml

+14-14
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ name: NUGET-PUSH
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
paths:
88
- '.github/.force-nuget-push'
99

1010
env:
1111
VERSION: ''
12-
BRANCH: 'master'
12+
BRANCH: 'main'
1313

1414
jobs:
1515
build:
@@ -23,34 +23,34 @@ jobs:
2323
with:
2424
setAllVars: true
2525
- name: Setting VERSION and BRANCH env
26-
run: echo "::set-env name=VERSION::$NBGV_NuGetPackageVersion"
26+
run: echo "::set-env name=VERSION::$NBGV_SimpleVersion$NBGV_PrereleaseVersion"
2727
- name: Update tokens in project files
2828
uses: cschleiden/replace-tokens@v1
2929
with:
3030
files: '["*.csproj", "**/*.csproj"]'
3131
- uses: actions/setup-dotnet@v1
3232
with:
33-
dotnet-version: '3.1.202'
33+
dotnet-version: '3.1.202'
3434
- name: Building library
3535
run: |
3636
dotnet restore src
37-
dotnet build src/bunit.core/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
38-
dotnet build src/bunit.web/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
39-
dotnet build src/bunit.xunit/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
40-
dotnet build src/bunit.testassets/ -c Release --no-restore
37+
dotnet build src/bunit.core/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
38+
dotnet build src/bunit.web/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
39+
dotnet build src/bunit.xunit/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
40+
dotnet build src/bunit.testassets/ -c Release --no-restore
4141
- name: Running unit tests
4242
run: |
4343
dotnet test src/bunit.core.tests/ -c Release --no-restore --verbosity normal /nowarn:CS1591
4444
dotnet test src/bunit.web.tests/ -c Release --no-restore --verbosity normal /nowarn:CS1591
4545
dotnet test src/bunit.xunit.tests/ -c Release --no-restore --verbosity normal /nowarn:CS1591
4646
- name: Creating library package
4747
run: |
48-
dotnet pack src/bunit.core/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
49-
dotnet pack src/bunit.web/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
50-
dotnet pack src/bunit.xunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
51-
dotnet pack src/bunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
48+
dotnet pack src/bunit.core/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
49+
dotnet pack src/bunit.web/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
50+
dotnet pack src/bunit.xunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
51+
dotnet pack src/bunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
5252
- name: Buidling template package
53-
run: dotnet pack src/bunit.template/ -c Release -o ${GITHUB_WORKSPACE}/packages
53+
run: dotnet pack src/bunit.template/ -c Release -o ${GITHUB_WORKSPACE}/packages /p:PublicRelease=true
5454
- name: Verifying template
5555
run: |
5656
dotnet new --install ${GITHUB_WORKSPACE}/packages/bunit.template.$VERSION.nupkg
@@ -67,4 +67,4 @@ jobs:
6767
done
6868
shell: bash
6969
#- name: Push packages to GitHub Package Registry
70-
# run: dotnet nuget push ${GITHUB_WORKSPACE}/packages/'*.nupkg' -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/egil/index.json --skip-duplicate
70+
# run: dotnet nuget push ${GITHUB_WORKSPACE}/packages/'*.nupkg' -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/egil/index.json --skip-duplicate

.github/workflows/RELEASE.yml

+22-19
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ on:
44
release:
55
types:
66
- published
7-
- edited
87

98
env:
109
VERSION: ''
11-
BRANCH: ''
10+
BRANCH: 'main'
1211

1312
jobs:
1413
build:
@@ -23,45 +22,49 @@ jobs:
2322
setAllVars: true
2423
- name: Setting VERSION and BRANCH env
2524
run: |
26-
echo "::set-env name=VERSION::$NBGV_NuGetPackageVersion"
25+
echo "::set-env name=VERSION::$NBGV_SimpleVersion$NBGV_PrereleaseVersion"
2726
echo "::set-env name=BRANCH::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')"
2827
- name: Update tokens in project files
2928
uses: cschleiden/replace-tokens@v1
3029
with:
3130
files: '["*.csproj", "**/*.csproj"]'
3231
- uses: actions/setup-dotnet@v1
3332
with:
34-
dotnet-version: '3.1.202'
35-
source-url: https://api.nuget.org/v3/index.json
36-
env:
37-
NUGET_AUTH_TOKEN: ${{secrets.NUGET_KEY}}
33+
dotnet-version: '3.1.202'
3834
- name: Building library
3935
run: |
4036
dotnet restore src
41-
dotnet build src/bunit.core/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
42-
dotnet build src/bunit.web/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
43-
dotnet build src/bunit.xunit/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
44-
dotnet build src/bunit.testassets/ -c Release --no-restore
37+
dotnet build src/bunit.core/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
38+
dotnet build src/bunit.web/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
39+
dotnet build src/bunit.xunit/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
40+
dotnet build src/bunit.testassets/ -c Release --no-restore
4541
- name: Running unit tests
4642
run: |
4743
dotnet test src/bunit.core.tests/ -c Release --no-restore --verbosity normal /nowarn:CS1591
4844
dotnet test src/bunit.web.tests/ -c Release --no-restore --verbosity normal /nowarn:CS1591
4945
dotnet test src/bunit.xunit.tests/ -c Release --no-restore --verbosity normal /nowarn:CS1591
5046
- name: Creating library package
5147
run: |
52-
dotnet pack src/bunit.core/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
53-
dotnet pack src/bunit.web/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
54-
dotnet pack src/bunit.xunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
55-
dotnet pack src/bunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
48+
dotnet pack src/bunit.core/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
49+
dotnet pack src/bunit.web/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
50+
dotnet pack src/bunit.xunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
51+
dotnet pack src/bunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
5652
- name: Buidling template package
57-
run: dotnet pack src/bunit.template/ -c Release -o ${GITHUB_WORKSPACE}/packages
53+
run: dotnet pack src/bunit.template/ -c Release -o ${GITHUB_WORKSPACE}/packages /p:PublicRelease=true
5854
- name: Verifying template
5955
run: |
6056
dotnet new --install ${GITHUB_WORKSPACE}/packages/bunit.template.$VERSION.nupkg
6157
dotnet new bunit --no-restore -o ${GITHUB_WORKSPACE}/Test
6258
dotnet restore ${GITHUB_WORKSPACE}/Test/Test.csproj --source ${GITHUB_WORKSPACE}/packages
6359
dotnet test ${GITHUB_WORKSPACE}/Test
64-
# - name: Push packages to NuGet
65-
# run: dotnet nuget push ${GITHUB_WORKSPACE}/packages/'*.nupkg' -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
60+
- name: Push packages to NuGet
61+
run: dotnet nuget push ${GITHUB_WORKSPACE}/packages/'*.nupkg' -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
62+
- name: Push packages to GitHub Package Registry
63+
run: |
64+
for f in ${GITHUB_WORKSPACE}/packages/*.nupkg
65+
do
66+
curl -vX PUT -u "egil:${{ secrets.GITHUB_TOKEN }}" -F package=@$f https://nuget.pkg.github.com/egil/
67+
done
68+
shell: bash
6669
# - name: Push packages to GitHub Package Registry
67-
# run: dotnet nuget push ${GITHUB_WORKSPACE}/packages/'*.nupkg' -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/egil/index.json --skip-duplicate
70+
# run: dotnet nuget push ${GITHUB_WORKSPACE}/packages/'*.nupkg' -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/egil/index.json --skip-duplicate

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Ignore Visual Studio temporary files, build results, and
22
## files generated by popular Visual Studio add-ons.
33
##
4-
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
4+
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
55

66
# User-specific files
77
*.suo

0 commit comments

Comments
 (0)