|
1 | | -name: Build |
2 | | -on: |
3 | | - push: |
4 | | - branches: |
5 | | - - master |
6 | | - pull_request: |
7 | | - types: [opened, synchronize, reopened] |
| 1 | +name: .NET Core CI |
| 2 | + |
| 3 | +on: [push] |
| 4 | + |
8 | 5 | jobs: |
9 | | - build: |
10 | | - name: Build |
11 | | - runs-on: windows-latest |
| 6 | + test: |
| 7 | + name: Test on .NET Core ${{ matrix.os }} |
| 8 | + runs-on: ${{ matrix.os }} |
| 9 | + strategy: |
| 10 | + matrix: |
| 11 | + os: [ubuntu-latest, macos-latest] |
| 12 | + |
12 | 13 | steps: |
13 | | - - name: Set up JDK 11 |
14 | | - uses: actions/setup-java@v1 |
15 | | - with: |
16 | | - java-version: 1.11 |
17 | | - - uses: actions/checkout@v2 |
18 | | - with: |
19 | | - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis |
20 | | - - name: Cache SonarCloud packages |
21 | | - uses: actions/cache@v1 |
22 | | - with: |
23 | | - path: ~\sonar\cache |
24 | | - key: ${{ runner.os }}-sonar |
25 | | - restore-keys: ${{ runner.os }}-sonar |
26 | | - - name: Cache SonarCloud scanner |
27 | | - id: cache-sonar-scanner |
28 | | - uses: actions/cache@v1 |
29 | | - with: |
30 | | - path: .\.sonar\scanner |
31 | | - key: ${{ runner.os }}-sonar-scanner |
32 | | - restore-keys: ${{ runner.os }}-sonar-scanner |
33 | | - - name: Install SonarCloud scanner |
34 | | - if: steps.cache-sonar-scanner.outputs.cache-hit != 'true' |
35 | | - shell: powershell |
36 | | - run: | |
37 | | - New-Item -Path .\.sonar\scanner -ItemType Directory |
38 | | - dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner |
39 | | - - name: Build and analyze |
40 | | - env: |
41 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any |
42 | | - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
43 | | - shell: powershell |
44 | | - run: | |
45 | | - dotnet tool install --global dotnet-coverage |
46 | | - .\.sonar\scanner\dotnet-sonarscanner begin /k:"unosquare_embedio" /o:"unosquare" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml |
47 | | - dotnet build --no-incremental -c Release |
48 | | - dotnet-coverage collect 'dotnet test' -f xml -o 'coverage.xml' |
49 | | - .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" |
| 14 | + - uses: actions/checkout@v2 |
| 15 | + - name: Setup .NET Core |
| 16 | + uses: actions/setup-dotnet@v1 |
| 17 | + with: |
| 18 | + dotnet-version: 5.0 |
| 19 | + - name: Test with dotnet |
| 20 | + run: dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:Exclude=[NUnit3.TestAdapter]* ./test/EmbedIO.Tests/EmbedIO.Tests.csproj -c Release |
| 21 | + - uses: codecov/codecov-action@v1 |
| 22 | + with: |
| 23 | + file: test/EmbedIO.Tests/coverage.info |
| 24 | + token: ${{ secrets.CODECOV_TOKEN }} |
0 commit comments