|
1 | | -name: .NET |
| 1 | +name: .NET CI |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | 5 | branches: [ main ] |
6 | 6 | pull_request: |
7 | 7 | branches: [ main ] |
8 | | - |
9 | | - |
10 | | - # Allows you to run this workflow manually from the Actions tab |
11 | 8 | workflow_dispatch: |
12 | 9 |
|
13 | 10 | jobs: |
14 | | - |
15 | 11 | build-and-test: |
16 | 12 | runs-on: ubuntu-latest |
17 | | - |
| 13 | + |
18 | 14 | steps: |
| 15 | + - name: Checkout |
| 16 | + uses: actions/checkout@v5 |
| 17 | + |
| 18 | + - name: Setup .NET |
| 19 | + uses: actions/setup-dotnet@v4 |
| 20 | + with: |
| 21 | + dotnet-version: 9.0.x |
| 22 | + |
| 23 | + - name: Restore dependencies |
| 24 | + run: dotnet restore Together.slnx |
19 | 25 |
|
20 | | - - uses: actions/checkout@v3 |
21 | | - - name: Setup .NET |
22 | | - uses: actions/setup-dotnet@v3 |
23 | | - with: |
24 | | - dotnet-version: 9.0.x |
25 | | - |
26 | | - # run build and test |
27 | | - - name: Restore dependencies |
28 | | - run: dotnet restore |
29 | | - |
30 | | - - name: Build |
31 | | - run: dotnet build --no-restore --configuration Release |
32 | | - |
33 | | - - name: Test and Collect Code Coverage |
34 | | - run: dotnet test --configuration Release -p:CollectCoverage=true -p:CoverletOutput=coverage/ |
| 26 | + - name: Build |
| 27 | + run: dotnet build Together.slnx --configuration Release --no-restore |
35 | 28 |
|
36 | | - - name: Copy coverage files |
37 | | - run: | |
38 | | - mkdir '${{ github.workspace }}/coverage' |
39 | | - find . -name "*.opencover.xml" -exec sh -c 'cp "$0" "coverage/coverage-$(basename $0)"' {} \; |
| 29 | + - name: Test and collect coverage |
| 30 | + run: dotnet test Together.slnx --configuration Release --no-build -p:CollectCoverage=true -p:CoverletOutput=coverage/ |
40 | 31 |
|
41 | | - - name: List coverage files |
42 | | - run: ls '${{ github.workspace }}/coverage/' |
| 32 | + - name: Copy coverage files |
| 33 | + run: | |
| 34 | + mkdir -p "${{ github.workspace }}/coverage" |
| 35 | + find . -name "*.opencover.xml" -exec sh -c 'cp "$1" "coverage/coverage-$(basename "$1")"' _ {} \; |
43 | 36 |
|
44 | | - - name: SonarCloud Scan |
45 | | - uses: sonarsource/sonarcloud-github-action@master |
46 | | - with: |
47 | | - args: > |
48 | | - -Dsonar.organization=managedcode |
49 | | - -Dsonar.projectKey=managedcode_Together |
50 | | - -Dsonar.token=${{ secrets.SONAR_TOKEN }} |
51 | | - -Dsonar.cs.opencover.reportsPaths=${{ github.workspace }}/coverage/ |
52 | | - env: |
53 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
54 | | - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
| 37 | + - name: List coverage files |
| 38 | + run: ls "${{ github.workspace }}/coverage/" |
55 | 39 |
|
56 | | - - name: Upload coverage reports to Codecov |
57 | | - uses: codecov/codecov-action@v3 |
58 | | - env: |
59 | | - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
60 | | - |
61 | | -# - name: coveralls |
62 | | -# uses: coverallsapp/github-action@master |
63 | | -# with: |
64 | | -# github-token: ${{secrets.GITHUB_TOKEN }} |
65 | | -# path-to-lcov: coverage/coverage.info |
| 40 | + - name: Upload coverage reports to Codecov |
| 41 | + uses: codecov/codecov-action@v4 |
| 42 | + env: |
| 43 | + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
0 commit comments