Initial commit #1
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: CI | |
on: | |
push: | |
branches: [ "*" ] | |
pull_request: | |
branches: [ "*" ] | |
jobs: | |
Build-and-Tests: | |
name: Build and Test | |
runs-on: ubuntu-18.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: running infrastructure | |
run: | | |
cd infrastructure | |
docker-compose up -d | |
sleep 2s | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 7.x.x | |
- name: Add Nuget | |
run: | | |
cd src | |
for proj in $(dotnet sln list | grep Tests) | |
do | |
dotnet add "$proj" package JunitXml.TestLogger || true | |
done | |
- name: Test | |
run: | | |
cd src | |
dotnet clean | |
dotnet restore | |
dotnet test --logger "junit;LogFileName=Report.xml" --collect:"XPlat Code Coverage" | |
- name: ReportGenerator | |
uses: danielpalme/[email protected] | |
with: | |
reports: '**/coverage.cobertura.xml' | |
reporttypes: 'Html;Badges' | |
targetdir: 'docs' # REQUIRED # The directory where the generated report should be saved. | |
historydir: 'docs/history' | |
sourcedirs: 'src' | |
- name: Push Report | |
uses: EndBug/add-and-commit@v4 | |
with: | |
add: 'docs/*' | |
message: "Coverage Report ${{github.sha}}" | |
ref: 'gh-pages' | |
remove: '' | |
if: ${{ github.ref == 'refs/heads/master' }} | |
- name: Publish Unit Test Results | |
uses: docker://ghcr.io/enricomi/publish-unit-test-result-action:v1 | |
if: ${{ github.ref == 'refs/heads/master' && always() }} | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
files: src/**/Report.xml |