|
8 | 8 | paths-ignore: |
9 | 9 | - '**/**.md' |
10 | 10 | jobs: |
11 | | - build: |
| 11 | + check-ci: |
12 | 12 | runs-on: windows-latest |
13 | 13 | steps: |
14 | 14 | - name: Checkout repository |
15 | 15 | uses: actions/checkout@v4 |
16 | | - - name: Set up NuGet |
17 | | - uses: NuGet/setup-nuget@v1.1.1 |
| 16 | + - name: Set up .NET SDK |
| 17 | + uses: actions/setup-dotnet@v4 |
| 18 | + with: |
| 19 | + dotnet-version: '5.0.x' |
| 20 | + - name: Cache NuGet packages |
| 21 | + uses: actions/cache@v2 |
| 22 | + with: |
| 23 | + path: | |
| 24 | + ~/.nuget/packages |
| 25 | + ~/.local/share/NuGet/Cache |
| 26 | + key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} |
| 27 | + restore-keys: | |
| 28 | + ${{ runner.os }}-nuget- |
18 | 29 | - name: Restore NuGet packages |
19 | 30 | run: nuget restore Parse.sln |
20 | | - - name: Install Chocolatey |
21 | | - run: Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) |
22 | | - - name: Install OpenCover and Codecov |
23 | | - run: | |
24 | | - choco install opencover.portable -y |
25 | | - choco install codecov -y |
| 31 | + - name: Install Chocolatey packages |
| 32 | + uses: crazy-max/ghaction-chocolatey@v1 |
| 33 | + with: |
| 34 | + args: 'install opencover.portable codecov -y' |
26 | 35 | - name: Build |
27 | | - run: msbuild Parse.sln /verbosity:minimal |
| 36 | + run: dotnet build Parse.sln --configuration Debug --no-restore |
28 | 37 | - name: Run tests with coverage |
29 | 38 | run: | |
30 | | - OpenCover.Console.exe -target:dotnet.exe -targetargs:"test --test-adapter-path:. --logger:console /p:DebugType=full .\Parse.Tests\Parse.Tests.csproj" -filter:"+[Parse*]* -[Parse.Tests*]*" -oldstyle -output:parse_sdk_dotnet_coverage.xml -register:user |
31 | | - - name: Upload coverage to Codecov |
32 | | - run: codecov -f "parse_sdk_dotnet_coverage.xml" |
| 39 | + OpenCover.Console.exe -target:dotnet.exe -targetargs:"test --configuration Debug --test-adapter-path:. --logger:console /p:DebugType=full .\Parse.Tests\Parse.Tests.csproj" -filter:"+[Parse*]* -[Parse.Tests*]*" -oldstyle -output:parse_sdk_dotnet_coverage.xml -register:user |
| 40 | + - name: Upload code coverage |
| 41 | + uses: codecov/codecov-action@v4 |
| 42 | + with: |
| 43 | + fail_ci_if_error: true |
| 44 | + token: ${{ secrets.CODECOV_TOKEN }} |
33 | 45 | # - name: Upload artifacts |
34 | 46 | # if: always() |
35 | 47 | # uses: actions/upload-artifact@v2 |
|
0 commit comments