mirror of
https://github.com/bitwarden/server
synced 2025-12-24 20:23:21 +00:00
72 lines
2.2 KiB
YAML
72 lines
2.2 KiB
YAML
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
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Set up .NET
|
|
uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0
|
|
|
|
- name: Install rust
|
|
uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # stable
|
|
with:
|
|
toolchain: stable
|
|
|
|
- name: Cache cargo registry
|
|
uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
|
|
|
|
- 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@890a17cecf52a379fc869ab770a71657660be727 # v2.1.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@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
|