Skip to content

CI

CI #1490

Workflow file for this run

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/