55 - pull_request
66
77jobs :
8- build :
9- name : Build
10- runs-on : ubuntu-latest
11-
12- env :
13- DOTNET_SKIP_FIRST_TIME_EXPERIENCE : " true"
14- DOTNET_CLI_TELEMETRY_OPTOUT : " 1"
15-
16- steps :
17- - name : Setup dotnet 2.1
18- uses : actions/setup-dotnet@v1
19- with :
20- dotnet-version : " 2.1.805"
21-
22- - name : Setup dotnet 5.0
23- uses : actions/setup-dotnet@v1
24- with :
25- dotnet-version : " 5.0.101"
26-
27- - name : Setup side by side .NET SDKs on *nix
28- run : |
29- rsync -a ${DOTNET_ROOT/${{ matrix.dotnet }}/2.1.805}/* $DOTNET_ROOT/
30-
31- - name : Print dotnet info
32- run : dotnet --info
33-
34- - uses : actions/checkout@master
35-
36- - name : Fetch all history for all tags and branches
37- run : git fetch --prune --unshallow
38-
39- - name : Restore
40- run : dotnet msbuild build/build.proj -target:Restore
41-
42- - name : Build
43- run : dotnet msbuild build/build.proj -target:Build -p:NoRestore=true
44-
45- - name : Test
46- run : dotnet msbuild build/build.proj -target:Test -p:NoRestore=true -p:VSTestNoBuild=true
47-
48- - name : Pack
49- run : dotnet msbuild build/build.proj -target:Pack
50-
51- - name : Write version to artifact
52- run : find artifacts -name '*.nupkg' | grep -oP '\d+\.\d+\.\d+(.*?)(?=.nupkg)' > artifacts/VERSION
53-
54- - name : Upload artifact
55- uses : actions/upload-artifact@v2
56- with :
57- name : package
58- retention-days : 5
59- path : |
60- artifacts/*.nupkg
61- artifacts/*.snupkg
62- artifacts/VERSION
63-
648 test :
659 name : Test
66- needs :
67- - build
6810 runs-on : ${{ matrix.os }}
6911 strategy :
7012 fail-fast : false
@@ -73,69 +15,68 @@ jobs:
7315 - macos-latest
7416 - windows-latest
7517 - ubuntu-latest
76- tfm :
77- - " netcoreapp2.1"
78- - " netcoreapp3.1"
79- - " net5.0"
80- include :
81- - tfm : " netcoreapp3.1"
82- dotnet : " 3.1.404"
8318
8419 env :
20+ DOTNET_NOLOGO : " true"
21+ DOTNET_CLI_TELEMETRY_OPTOUT : " true"
8522 DOTNET_SKIP_FIRST_TIME_EXPERIENCE : " true"
86- DOTNET_CLI_TELEMETRY_OPTOUT : " 1"
8723
8824 steps :
89- - name : Setup dotnet 2.1
25+ - name : ⏬ Checkout
26+ uses : actions/checkout@v2
27+ with :
28+ fetch-depth : 0
29+
30+ - name : 🔽 Setup dotnet 2.1
9031 uses : actions/setup-dotnet@v1
9132 with :
92- dotnet-version : " 2.1.805 "
33+ dotnet-version : " 2.1.x "
9334
94- - name : Setup dotnet ${{ matrix.dotnet }}
95- if : ${{ matrix.dotnet }} != ''
35+ - name : 🔽 Setup dotnet 3.1
9636 uses : actions/setup-dotnet@v1
9737 with :
98- dotnet-version : ${{ matrix.dotnet }}
38+ dotnet-version : " 3.1.x "
9939
100- - name : Setup dotnet 5.0
40+ - name : 🔽 Setup dotnet from global.json
10141 uses : actions/setup-dotnet@v1
42+
43+ - name : 🔽 Install GitVersion
44+ uses :
gittools/actions/gitversion/[email protected] 10245 with :
103- dotnet-version : " 5.0.101 "
46+ versionSpec : " 5.x "
10447
105- - name : Print dotnet info
48+ - name : 🔍 Print dotnet info
10649 run : dotnet --info
10750
108- - uses : actions/checkout@master
51+ - name : 🔍 Determine Version
52+ id : gitversion
53+ uses :
gittools/actions/gitversion/[email protected] 54+ with :
55+ useConfigFile : true
56+
57+ - name : 🔽 Restore
58+ run : dotnet restore -p:Configuration=Release
59+
60+ - name : 🔨 Build
61+ run : dotnet build --configuration Release
62+
63+ - name : 🧪 Test
64+ run : dotnet test --no-build --configuration Release
65+
66+ - name : 📦 Pack
67+ run : dotnet pack --configuration Release --no-build
68+ if : ${{ matrix.os == 'ubuntu-latest' }}
10969
110- - name : Download package
111- uses : actions/download-artifact@v2
70+ - name : 🔼 Upload packages as artifact
71+ uses : actions/upload-artifact@v2
72+ if : ${{ matrix.os == 'ubuntu-latest' }}
73+ with :
74+ name : nuget
75+ path : artifacts/nuget/
76+
77+ - name : 🔼 Upload global.json as artifact
78+ uses : actions/upload-artifact@v2
79+ if : ${{ matrix.os == 'ubuntu-latest' }}
11280 with :
113- name : package
114- path : ~/packages/YoloDev.Expecto.TestSdk
115-
116- - name : Set version env var
117- run : |
118- VERSION=$(<~/packages/YoloDev.Expecto.TestSdk/VERSION)
119- echo "TEST_VERSION=$VERSION" >>$GITHUB_ENV
120- shell : bash
121-
122- - name : Display structure of downloaded files
123- run : ls -R ~/packages/YoloDev.Expecto.TestSdk
124- shell : pwsh
125-
126- - name : Restore test project with local package
127- run : |
128- $local = Resolve-Path ~/packages/YoloDev.Expecto.TestSdk
129- dotnet nuget add source $local -n local-packages
130- # Write-Host $local
131- # Write-Host $remote
132- dotnet restore test/Sample.Test -p:CiTestTfm=${{ matrix.tfm }} -p:CiTestVersion=${{ env.TEST_VERSION }}
133- shell : pwsh
134-
135- - name : Build test project
136- run : dotnet build --no-restore test/Sample.Test -p:CiTestTfm=${{ matrix.tfm }} -p:CiTestVersion=${{ env.TEST_VERSION }}
137- shell : pwsh
138-
139- - name : Test project
140- run : dotnet test --no-build --no-restore test/Sample.Test -p:CiTestTfm=${{ matrix.tfm }} -p:CiTestVersion=${{ env.TEST_VERSION }}
141- shell : pwsh
81+ name : global-json
82+ path : global.json
0 commit comments