-
Notifications
You must be signed in to change notification settings - Fork 449
74 lines (73 loc) · 3.18 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: CI
on:
push:
branches:
- main
pull_request:
schedule:
- cron: 0 0 * * *
jobs:
UnitTests:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Run Unit Tests
# We don't have a good cross-platform way of splitting long lines
run: |
dotnet test dropbox-sdk-dotnet/Dropbox.Api.Unit.Tests --collect:"XPlat Code Coverage" -- 'DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.ExcludeByFile=**/Generated/**/*.cs'
- name: Publish Coverage
uses: codecov/codecov-action@v1.3.2
if: matrix.os == 'ubuntu-latest'
with:
flags: unit
fail_ci_if_error: true
directory: dropbox-sdk-dotnet/Dropbox.Api.Unit.Tests/TestResults/
IntegrationTests:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
max-parallel: 1
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Test Legacy User
env:
DROPBOX_INTEGRATION_appKey: ${{ secrets.LEGACY_APP_KEY }}
DROPBOX_INTEGRATION_appSecret: ${{ secrets.LEGACY_APP_SECRET }}
DROPBOX_INTEGRATION_userAccessToken: ${{ secrets.LEGACY_APP_ACCESS_TOKEN }}
DROPBOX_INTEGRATION_userRefreshToken: ${{ secrets.LEGACY_APP_REFRESH_TOKEN }}
DROPBOX_INTEGRATION_teamAccessToken: ${{ secrets.TEAM_APP_ACCESS_TOKEN }}
run: |
dotnet test dropbox-sdk-dotnet/Dropbox.Api.Integration.Tests --collect:"XPlat Code Coverage" -- 'DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.ExcludeByFile=**/Generated/**/*.cs'
- name: Test Scoped User
env:
DROPBOX_INTEGRATION_appKey: ${{ secrets.SCOPED_APP_KEY }}
DROPBOX_INTEGRATION_appSecret: ${{ secrets.SCOPED_APP_SECRET }}
DROPBOX_INTEGRATION_userAccessToken: ${{ secrets.SCOPED_APP_ACCESS_TOKEN }}
DROPBOX_INTEGRATION_userRefreshToken: ${{ secrets.SCOPED_APP_REFRESH_TOKEN }}
DROPBOX_INTEGRATION_teamAccessToken: ${{ secrets.TEAM_APP_ACCESS_TOKEN }}
run: |
dotnet test dropbox-sdk-dotnet/Dropbox.Api.Integration.Tests --collect:"XPlat Code Coverage" -- 'DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.ExcludeByFile=**/Generated/**/*.cs'
- name: Publish Coverage
uses: codecov/codecov-action@v1.3.2
if: matrix.os == 'ubuntu-latest'
with:
flags: integration
fail_ci_if_error: true
directory: dropbox-sdk-dotnet/Dropbox.Api.Integration.Tests/TestResults/
Linter:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Run Linter
run: |
# Install latest dotnet-format
dotnet tool install -g dotnet-format --version 6.0.241801 --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json
dotnet restore dropbox-sdk-dotnet/
dotnet format --check --fix-whitespace --fix-style warn --fix-analyzers warn dropbox-sdk-dotnet/