Skip to content

Update OdooModelMapper.cs #182

Update OdooModelMapper.cs

Update OdooModelMapper.cs #182

Workflow file for this run

name: Build and Test
on:
push:
branches: [ master, release ]
pull_request:
branches: [ master, release ]
jobs:
build:
runs-on: ubuntu-latest
env:
config: 'Release'
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build PR
run: dotnet build --configuration $config --no-restore
# set pr number, if it's a pr build (if pr)
- name: set pr build number
id: PRNUMBER
if: ${{ github.event_name == 'pull_request' }}
uses: kkak10/[email protected]
# set report file and title (if pr)
- name: Set Test Title
run: |
if ${{ github.event_name == 'pull_request' }}
then
echo "title=Test Run for PR #${{steps.PRNUMBER.outputs.pr}} (${{github.run_number}})" >> $GITHUB_ENV
echo "file_name=TestReport.${{steps.PRNUMBER.outputs.pr}}.${{github.run_number}}.md" >> $GITHUB_ENV
else
echo "title=Test Run ${{github.run_number}}" >> $GITHUB_ENV
echo "file_name=TestReport.${{github.run_number}}.md" >> $GITHUB_ENV
fi
- name: Test
run: dotnet test PortaCapena.OdooJsonRpcClient.Tests/PortaCapena.OdooJsonRpcClient.Tests.csproj --configuration $config --no-build --no-restore --logger:"liquid.md;LogFileName=${{github.workspace}}/${{env.file_name}};Title=${{env.title}};" --collect:"XPlat Code Coverage" --results-directory ./coverage
# upload report as build artifact
- name: Upload a Build Artifact
uses: actions/upload-artifact@v2
if: ${{always()}}
with:
name: 'Test Run'
path: ${{github.workspace}}/${{env.file_name}}
# add report as PR comment (if PR)
- name: comment PR
uses: machine-learning-apps/pr-comment@master
if: ${{ github.event_name == 'pull_request' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
path: ${{env.file_name}}
- name: Code Coverage Report
uses: irongut/[email protected]
with:
filename: coverage/**/coverage.cobertura.xml
badge: true
fail_below_min: true
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
thresholds: '5 60'
- name: Add Coverage Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md