Add readme (#25) #115
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: Run code tests | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
- develop | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
- windows-latest | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Use .NET Core SDK | |
uses: actions/setup-dotnet@v4 | |
with: | |
global-json-file: global.json | |
source-url: https://nuget.pkg.github.com/Shane32/index.json | |
env: | |
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Build solution [Release] | |
run: dotnet build --no-restore -c Release | |
- name: Build solution [Debug] | |
run: dotnet build --no-restore | |
- name: Test solution [Debug] | |
run: dotnet test --no-restore --no-build -p:CollectCoverage=true -p:CoverletOutputFormat=lcov -p:CoverletOutput=../../${{ matrix.os }}.lcov.info | |
# ==== code coverage reports (ubuntu-latest only) ==== | |
- name: Convert coverage report to clover & htmlsummary format | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
uses: danielpalme/[email protected] | |
with: | |
reports: '${{ matrix.os }}.lcov.info' | |
targetdir: '.' | |
reporttypes: 'Clover;HtmlSummary' | |
tag: 'test_${{ github.run_number }}' | |
- name: Convert coverage report to html | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
uses: danielpalme/[email protected] | |
with: | |
reports: '${{ matrix.os }}.lcov.info' | |
targetdir: './cloverreport' | |
reporttypes: 'Html' | |
tag: 'test_${{ github.run_number }}' | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Code coverage artifacts for ${{ matrix.os }} | |
path: | | |
${{ matrix.os }}.lcov.info | |
Clover.xml | |
cloverreport/** | |
summary.html | |
- name: Monitor coverage | |
if: ${{ matrix.os == 'ubuntu-latest' && github.event_name == 'pull_request' }} | |
uses: slavcodev/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
clover_file: "Clover.xml" | |
threshold_alert: 80 | |
threshold_warning: 90 | |
# https://github.com/marketplace/actions/coveralls-github-action | |
- name: Upload coverage to Coveralls | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
uses: coverallsapp/[email protected] | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN }} | |
path-to-lcov: ${{ matrix.os }}.lcov.info | |
parallel: true | |
flag-name: ${{ matrix.os }} | |
- name: Upload coverage to Codecov | |
if: ${{ 0 == 1 }} | |
uses: codecov/codecov-action@v1 | |
with: | |
file: ${{ matrix.os }}.lcov.info | |
flags: unittests # optional | |
name: codecov-umbrella # optional | |
fail_ci_if_error: true # optional (default = false) | |
verbose: true # optional (default = false) | |
finish: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Coveralls Finished | |
uses: coverallsapp/[email protected] | |
with: | |
github-token: ${{ secrets.github_token }} | |
parallel-finished: true |