refactor(test): add interfaces for easier mocking #255
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
pull_request: | |
branches: | |
- 'main' | |
push: | |
branches: | |
- '*' | |
paths-ignore: | |
- 'README.md' | |
- 'LICENSE' | |
- 'CODE_OF_CONDUCT.md' | |
- 'CONTRIBUTING.md' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
dotnet-version: [ '3.1.x', '7.0.x' ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup .NET SDK ${{ matrix.dotnet-version }} | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ matrix.dotnet-version }} | |
- name: Install dependencies for .NET Core 3.1 | |
if: ${{ matrix.dotnet-version == '3.1.x' }} | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y wget | |
wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl1.1/libssl1.1_1.1.1f-1ubuntu2.16_amd64.deb | |
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.16_amd64.deb | |
sudo apt-get -f install | |
- name: Restore dependencies | |
run: dotnet restore | |
env: | |
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 | |
- name: Build | |
run: dotnet build -c Release --no-restore | |
- name: Test | |
run: dotnet test --no-restore --verbosity normal | |
code-coverage: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 7.0.x | |
- name: Test | |
run: dotnet test --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura | |
- name: Generate code coverage report | |
uses: danielpalme/[email protected] | |
with: | |
reports: '**/coverage.cobertura.xml' | |
targetdir: 'CodeCoverage' | |
reporttypes: 'Cobertura' | |
- name: Publish code coverage report | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: '**/coverage.cobertura.xml' |