Skip to content

Commit 02beced

Browse files
emmaworleyConnor Worley
andauthored
Initial attempt at building/testing/publishing under linux (#196)
* Initial attempt at building/testing/publishing under linux * replace backslash with forwardslash * Attempt to add unit test coverage reports * try to fix gh actions syntax error * try to fix gh actions syntax error again * try to fix conditional expression for publishing coverage * try to fix conditional expression for publishing coverage again * only run CI on ubuntu * PR feedback * no multi-line run directives on windows Co-authored-by: Connor Worley <[email protected]>
1 parent de96458 commit 02beced

File tree

22 files changed

+334
-1160
lines changed

22 files changed

+334
-1160
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,30 @@ on:
33
pull_request:
44

55
jobs:
6-
DotNetFramework:
7-
continue-on-error: true
8-
runs-on: windows-latest
6+
UnitTests:
7+
strategy:
8+
matrix:
9+
os: [macos-latest, ubuntu-latest, windows-latest]
10+
runs-on: ${{ matrix.os }}
911
steps:
1012
- uses: actions/checkout@v2
11-
- name: Setup NuGet.exe
12-
uses: nuget/[email protected]
13-
with:
14-
nuget-version: latest
15-
- name: Setup MSBuild
16-
uses: microsoft/[email protected]
17-
- name: Setup VSTest.console.exe
18-
uses: darenm/[email protected]
19-
- name: Restore Packages
20-
run: nuget restore dropbox-sdk-dotnet\Dropbox.Api.sln
21-
- name: Build
22-
run: msbuild dropbox-sdk-dotnet\Dropbox.Api\Dropbox.Api.csproj -p:Configuration=Release
23-
- name: Build Tests
24-
run: msbuild dropbox-sdk-dotnet\Dropbox.Api.Unit.Tests\Dropbox.Api.Unit.Tests.csproj -p:Configuration=Debug
2513
- name: Run Unit Tests
26-
run: vstest.console dropbox-sdk-dotnet\Dropbox.Api.Unit.Tests\bin\Debug\Dropbox.Api.Unit.Tests.dll
14+
run: |
15+
dotnet test dropbox-sdk-dotnet/Dropbox.Api.Unit.Tests
16+
Coverage:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Run Unit Tests
21+
run: |
22+
dotnet test \
23+
dropbox-sdk-dotnet/Dropbox.Api.Unit.Tests \
24+
--collect:"XPlat Code Coverage" \
25+
-- \
26+
'DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.ExcludeByFile=**/Generated/**/*.cs'
27+
- name: Publish Coverage
28+
uses: codecov/[email protected]
29+
with:
30+
flags: unit
31+
fail_ci_if_error: true
32+
directory: dropbox-sdk-dotnet/Dropbox.Api.Unit.Tests/TestResults/

.github/workflows/nuget_upload.yml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish to Nuget
1+
name: Publish to NuGet
22

33
on:
44
workflow_dispatch:
@@ -7,22 +7,20 @@ on:
77

88
jobs:
99
deploy:
10-
runs-on: windows-latest
10+
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v2
13-
- name: Setup NuGet.exe
14-
uses: nuget/[email protected]
15-
with:
16-
nuget-version: latest
17-
- name: Setup MSBuild
18-
uses: microsoft/[email protected]
19-
- name: Restore Packages
20-
run: nuget restore dropbox-sdk-dotnet\Dropbox.Api.sln
21-
- name: Build
22-
run: msbuild dropbox-sdk-dotnet\Dropbox.Api\Dropbox.Api.csproj -p:Configuration=Release
2313
- name: Pack
24-
run: nuget pack dropbox-sdk-dotnet\Dropbox.Api\Dropbox.Api.nuspec
25-
- name: Publish
2614
run: |
27-
nuget setApiKey ${{ secrets.NUGET_TOKEN }}
28-
nuget push *.nupkg -Source https://api.nuget.org/v3/index.json
15+
dotnet pack \
16+
dropbox-sdk-dotnet/Dropbox.Api \
17+
-p:Configuration=Release \
18+
-p:Version=$(echo "${{ github.event.release.tag_name }}" | cut -c 2-) \
19+
-p:AssemblyOriginatorKeyFile=dropbox_api_key.snk \
20+
-p:SignAssembly=true
21+
- name: Push
22+
run: |
23+
dotnet nuget push \
24+
dropbox-sdk-dotnet/Dropbox.Api/bin/Release/Dropbox.Api.$(echo "${{ github.event.release.tag_name }}" | cut -c 2-).nupkg \
25+
--source https://api.nuget.org/v3/index.json \
26+
--api-key ${{ secrets.NUGET_TOKEN }}

.github/workflows/spec_update.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Spec Update
2-
on:
2+
on:
33
workflow_dispatch:
44
repository_dispatch:
55
types: [spec_update]
@@ -49,11 +49,7 @@ jobs:
4949
echo "::set-output name=commit::$commit"
5050
- name: Generate New Routes
5151
run: |
52-
cd stone
53-
python -m pip install --upgrade pip
54-
python setup.py install
55-
cd ..
56-
python generate.py
52+
./scripts/generate_stone.ps1
5753
git add dropbox-sdk-dotnet/Dropbox.Api/Generated
5854
git add stone
5955
git add spec

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/dropbox-sdk-dotnet/Dropbox.Api.Tests/dropbox.runsettings
2+
/venv/
23

34
## Visual studio stuff
45
*.suo

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
[submodule "spec"]
22
path = spec
33
url = https://github.com/dropbox/dropbox-api-spec.git
4-
[submodule "stone"]
5-
path = stone
6-
url = https://github.com/dropbox/stone.git

buildall.ps1

Lines changed: 0 additions & 210 deletions
This file was deleted.

0 commit comments

Comments
 (0)