|
| 1 | +name: Build, test (Pull Request) |
| 2 | +on: |
| 3 | + pull_request: |
| 4 | + branches: |
| 5 | + - master |
| 6 | + workflow_dispatch: |
| 7 | +jobs: |
| 8 | + build: |
| 9 | + runs-on: windows-latest |
| 10 | + env: |
| 11 | + ACTIONS_ALLOW_UNSECURE_COMMANDS: true |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v1 |
| 14 | + name: Checkout Code |
| 15 | + |
| 16 | + - name: Setup MSBuild Ppth |
| 17 | + uses: microsoft/setup-msbuild@v1 |
| 18 | + |
| 19 | + - name: Setup NuGet |
| 20 | + |
| 21 | + |
| 22 | + - name: Restore NuGet Packages |
| 23 | + run: nuget restore QRCoder.sln |
| 24 | + |
| 25 | + - name: Build library |
| 26 | + run: msbuild QRCoder.sln /p:Configuration=Release /nr:false /t:Rebuild |
| 27 | + |
| 28 | + - name: Upload artifacts |
| 29 | + |
| 30 | + with: |
| 31 | + name: Compiled project |
| 32 | + path: D:\a\qrcoder\qrcoder |
| 33 | + |
| 34 | + test: |
| 35 | + needs: build |
| 36 | + runs-on: windows-latest |
| 37 | + steps: |
| 38 | + - name: Download artifacts |
| 39 | + |
| 40 | + with: |
| 41 | + name: Compiled project |
| 42 | + path: D:\a\qrcoder\qrcoder |
| 43 | + - name: Run test .NET 3.5 |
| 44 | + run: dotnet test -c Release -f net35 --nologo --no-build # No coverage for NET3.5 because of bug in combination with Coverlet+Stron naming |
| 45 | + - name: Run test .NET 4.52 |
| 46 | + run: dotnet test -c Release -f net452 --nologo --no-build # No coverage for NET4.5 because of bug in combination with Coverlet+Stron naming |
| 47 | +# Skip 1.1 test due to missing support on Github runner |
| 48 | +# - name: Run test .NET Core 1.1 |
| 49 | +# run: dotnet test -c Release -f netcoreapp1.1 --nologo |
| 50 | + - name: Run test .NET Core 2.0 |
| 51 | + run: dotnet test -c Release -f netcoreapp2.0 --nologo /p:CollectCoverage=true /p:CoverletOutputFormat=opencover |
| 52 | + - name: Run test .NET 5.0 |
| 53 | + run: dotnet test -c Release -f net5.0 --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover |
| 54 | + - name: Run test .NET 5.0 Windows |
| 55 | + run: dotnet test -c Release -f net5.0-windows --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover |
| 56 | + |
| 57 | + clean: |
| 58 | + needs: [build, test] |
| 59 | + if: always() |
| 60 | + runs-on: windows-latest |
| 61 | + steps: |
| 62 | + - name: Delete artifacts |
| 63 | + |
| 64 | + with: |
| 65 | + name: Compiled project |
0 commit comments