You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.9 KiB
61 lines
1.9 KiB
name: Testing |
|
|
|
on: |
|
workflow_dispatch: |
|
push: |
|
branches: |
|
- "main" |
|
- "rc" |
|
- "hotfix-rc" |
|
pull_request: |
|
|
|
env: |
|
_AZ_REGISTRY: "bitwardenprod.azurecr.io" |
|
|
|
jobs: |
|
testing: |
|
name: Run tests |
|
if: ${{ startsWith(github.head_ref, 'version_bump_') == false }} |
|
runs-on: ubuntu-22.04 |
|
permissions: |
|
checks: write |
|
contents: read |
|
pull-requests: write |
|
|
|
env: |
|
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages |
|
|
|
steps: |
|
- name: Check out repo |
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
|
|
|
- name: Set up .NET |
|
uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # v4.2.0 |
|
|
|
- name: Print environment |
|
run: | |
|
dotnet --info |
|
nuget help | grep Version |
|
echo "GitHub ref: $GITHUB_REF" |
|
echo "GitHub event: $GITHUB_EVENT" |
|
|
|
- name: Remove SQL project |
|
run: dotnet sln bitwarden-server.sln remove src/Sql/Sql.sqlproj |
|
|
|
- name: Test OSS solution |
|
run: dotnet test ./test --configuration Debug --logger "trx;LogFileName=oss-test-results.trx" /p:CoverletOutputFormatter="cobertura" --collect:"XPlat Code Coverage" |
|
|
|
- name: Test Bitwarden solution |
|
run: dotnet test ./bitwarden_license/test --configuration Debug --logger "trx;LogFileName=bw-test-results.trx" /p:CoverletOutputFormatter="cobertura" --collect:"XPlat Code Coverage" |
|
|
|
- name: Report test results |
|
uses: dorny/test-reporter@6e6a65b7a0bd2c9197df7d0ae36ac5cee784230c # v2.0.0 |
|
if: ${{ github.event.pull_request.head.repo.full_name == github.repository && !cancelled() }} |
|
with: |
|
name: Test Results |
|
path: "**/*-test-results.trx" |
|
reporter: dotnet-trx |
|
fail-on-error: true |
|
|
|
- name: Upload to codecov.io |
|
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5.1.2
|
|
|