|
| 1 | + |
| 2 | +name: Pull Request |
| 3 | + |
| 4 | +on: |
| 5 | + pull_request: |
| 6 | + branches: |
| 7 | + - 'dev' |
| 8 | + |
| 9 | +jobs: |
| 10 | + |
| 11 | + test-linux: |
| 12 | + |
| 13 | + runs-on: ubuntu-latest |
| 14 | + |
| 15 | + env: |
| 16 | + Solution_Name: GofPatterns.sln |
| 17 | + Test_Project_Path: GofPatternsTests\GofPatternsTests.csproj |
| 18 | + |
| 19 | + steps: |
| 20 | + - name: Checkout |
| 21 | + uses: actions/checkout@v3 |
| 22 | + with: |
| 23 | + fetch-depth: 0 |
| 24 | + |
| 25 | + - name: Install .NET Core |
| 26 | + uses: actions/setup-dotnet@v3 |
| 27 | + with: |
| 28 | + dotnet-version: 6.0.x |
| 29 | + |
| 30 | + - name: Restore dependencies |
| 31 | + run: dotnet restore |
| 32 | + |
| 33 | + - name: Build |
| 34 | + run: dotnet build --configuration Debug --no-restore |
| 35 | + |
| 36 | + - name: Test |
| 37 | + run: dotnet test --configuration Debug --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage |
| 38 | + |
| 39 | + - name: Code Coverage Result MD |
| 40 | + uses: irongut/CodeCoverageSummary@v1.3.0 |
| 41 | + with: |
| 42 | + filename: coverage/**/coverage.cobertura.xml |
| 43 | + badge: true |
| 44 | + fail_below_min: true |
| 45 | + format: markdown |
| 46 | + hide_branch_rate: false |
| 47 | + hide_complexity: true |
| 48 | + indicators: true |
| 49 | + output: both |
| 50 | + thresholds: '80 90' |
| 51 | + |
| 52 | + - name: Code Coverage Result MD |
| 53 | + uses: marocchino/sticky-pull-request-comment@v2 |
| 54 | + with: |
| 55 | + recreate: true |
| 56 | + path: code-coverage-results.md |
| 57 | + |
| 58 | + - name: Write to Job Summary |
| 59 | + run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY |
| 60 | + |
| 61 | + test-windows: |
| 62 | + |
| 63 | + runs-on: windows-latest |
| 64 | + |
| 65 | + env: |
| 66 | + Solution_Name: GofPatterns.sln |
| 67 | + Test_Project_Path: GofPatternsTests\GofPatternsTests.csproj |
| 68 | + |
| 69 | + steps: |
| 70 | + - name: Checkout |
| 71 | + uses: actions/checkout@v3 |
| 72 | + with: |
| 73 | + fetch-depth: 0 |
| 74 | + |
| 75 | + - name: Install .NET Core |
| 76 | + uses: actions/setup-dotnet@v3 |
| 77 | + with: |
| 78 | + dotnet-version: 6.0.x |
| 79 | + |
| 80 | + - name: Setup MSBuild.exe |
| 81 | + uses: microsoft/setup-msbuild@v1.0.2 |
| 82 | + |
| 83 | + - name: Restore dependencies |
| 84 | + run: dotnet restore |
| 85 | + |
| 86 | + - name: Build |
| 87 | + run: dotnet build |
| 88 | + |
| 89 | + - name: Test |
| 90 | + run: dotnet test |
| 91 | + |
| 92 | + - name: Restore the application |
| 93 | + run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration |
| 94 | + env: |
| 95 | + Configuration: Debug |
0 commit comments