Skip to content

Commit a77a90d

Browse files
committed
Updated build scripts
Only publish CI package on push to master. At PR only build and run tests.
1 parent 30f8a94 commit a77a90d

File tree

2 files changed

+66
-5
lines changed

2 files changed

+66
-5
lines changed

.github/workflows/wf-build-release-ci.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
name: Build, test, pack, push (CI)
22
on:
3-
43
push:
54
branches:
6-
- master
7-
pull_request:
8-
branches:
9-
- master
5+
- master
106
workflow_dispatch:
117
jobs:
128
build:

.github/workflows/wf-build-test.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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+
uses: NuGet/[email protected]
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+
uses: actions/[email protected]
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+
uses: actions/[email protected]
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+
uses: GeekyEggo/[email protected]
64+
with:
65+
name: Compiled project

0 commit comments

Comments
 (0)