Skip to content

Commit 286017f

Browse files
committed
Merge branch 'main' into dev
# Conflicts: # .github/pull_request_template.md # src/bunit.sln # version.json
2 parents 8742dfd + 14e5c3d commit 286017f

File tree

141 files changed

+3622
-440
lines changed

Some content is hidden

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

141 files changed

+3622
-440
lines changed

.github/pull_request_template.md

Lines changed: 18 additions & 0 deletions
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

Lines changed: 24 additions & 22 deletions
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/NUGET-PUSH.yml

Lines changed: 14 additions & 14 deletions
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

Lines changed: 22 additions & 19 deletions
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

Lines changed: 1 addition & 1 deletion
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

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,10 +373,10 @@ The latest version of the library is availble on NuGet:
373373

374374
- **Added logging to TestRenderer.** To make it easier to understand the rendering life-cycle during a test, the `TestRenderer` will now log when ever it dispatches an event or renders a component (the log statements can be access by capturing debug logs in the test results, as mentioned above).
375375

376-
- **Added some of the Blazor frameworks end-2-end tests.** To get better test coverage of the many rendering scenarios supported by Blazor, the [ComponentRenderingTest.cs](https://github.com/dotnet/aspnetcore/blob/master/src/Components/test/E2ETest/Tests/ComponentRenderingTest.cs) tests from the Blazor frameworks test suite has been converted from a Selenium to a bUnit. The testing style is very similar, so few changes was necessary to port the tests. The two test classes are here, if you want to compare:
376+
- **Added some of the Blazor frameworks end-2-end tests.** To get better test coverage of the many rendering scenarios supported by Blazor, the [ComponentRenderingTest.cs](https://github.com/dotnet/aspnetcore/blob/main/src/Components/test/E2ETest/Tests/ComponentRenderingTest.cs) tests from the Blazor frameworks test suite has been converted from a Selenium to a bUnit. The testing style is very similar, so few changes was necessary to port the tests. The two test classes are here, if you want to compare:
377377

378-
- [bUnit's ComponentRenderingTest.cs](/master/tests/BlazorE2E/ComponentRenderingTest.cs)
379-
- [Blazor's ComponentRenderingTest.cs](https://github.com/dotnet/aspnetcore/blob/master/src/Components/test/E2ETest/Tests/ComponentRenderingTest.cs)
378+
- [bUnit's ComponentRenderingTest.cs](/main/tests/BlazorE2E/ComponentRenderingTest.cs)
379+
- [Blazor's ComponentRenderingTest.cs](https://github.com/dotnet/aspnetcore/blob/main/src/Components/test/E2ETest/Tests/ComponentRenderingTest.cs)
380380

381381
### Changed
382382
- **Namespaces is now `Bunit`**

CONTRIBUTING.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# How to contribute
2+
3+
One of the easiest ways to contribute is to participate in discussions on GitHub issues. You can also contribute by submitting pull requests with code changes.
4+
5+
## General feedback and discussions?
6+
Start a discussion on the [issues list](https://github.com/egil/bunit/issues). Be sure to use the right template.
7+
8+
## Bugs and feature requests?
9+
For bugs or feature requests, log a new issue on the [issues list](https://github.com/egil/bunit/issues). Be sure to use the right template.
10+
11+
## Contributing code and content
12+
13+
bUnit accept fixes and features! Here is what you should do when writing code for bUnit:
14+
15+
- Follow the coding conventions used in the project. In general, they align with the AspNetCore teams [coding guidelines](https://github.com/dotnet/aspnetcore/wiki/Engineering-guidelines#coding-guidelines).
16+
- Add, remove, or delete unit tests to cover your changes. Make sure tests are specific to the changes you are making. Tests need to be provided for every bug/feature that is completed.
17+
- All code changes should be done on the `DEV` branch, and pull requests should target it.
18+
- All updates to the documentation, located under `./docs/` should be done on the `main` branch **if** they are general in nature and not tied to a specific version. Changes to the documentation related to changes on the `DEV` branch should be submitted to the `DEV` branch.
19+
- Any code or documentation you share with the bUnit projects should fall under the projects license agreement.
20+
21+
Here are some resources to help you get started on how to contribute code or new content.
22+
23+
* ["Help wanted" issues](https://github.com/egil/bunit/labels/help%20wanted) - these issues are up for grabs. Comment on an issue if you want to create a fix.
24+
* ["Good first issue" issues](https://github.com/egil/bunit/labels/good%20first%20issue) - these are a good for newcomers.
25+
26+
### Identifying the scale
27+
28+
If you would like to contribute to one of our repositories, first identify the scale of what you would like to contribute. If it is small (grammar/spelling or a bug fix) feel free to start working on a fix. If you are submitting a feature or substantial code contribution, please discuss it with the us first.
29+
30+
You might also read these two blogs posts on contributing code: [Open Source Contribution Etiquette](http://tirania.org/blog/archive/2010/Dec-31.html) by Miguel de Icaza and [Don't "Push" Your Pull Requests](https://www.igvita.com/2011/12/19/dont-push-your-pull-requests/) by Ilya Grigorik.
31+
32+
All code submissions will be rigorously reviewed and tested, and only those that meet an high bar for both quality and design/roadmap appropriateness will be merged into the source.
33+
34+
### Submitting a pull request
35+
36+
If you don't know what a pull request is read this article: https://help.github.com/articles/using-pull-requests. Make sure the repository can build and all tests pass. Familiarize yourself with the project workflow and our coding conventions.
37+
38+
## Code of conduct
39+
40+
See [CODE-OF-CONDUCT.md](./CODE-OF-CONDUCT.md)

0 commit comments

Comments
 (0)