CI #1857
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
schedule: | |
- cron: 0 0 * * * | |
jobs: | |
UnitTests: | |
strategy: | |
matrix: | |
os: [macos-13, ubuntu-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Add .Net 5 Framework | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '5.x' | |
- 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@v4 | |
if: matrix.os == 'ubuntu-latest' | |
with: | |
flags: unit | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
directory: dropbox-sdk-dotnet/Dropbox.Api.Unit.Tests/TestResults/ | |
IntegrationTests: | |
strategy: | |
matrix: | |
os: [macos-13, ubuntu-latest, windows-latest] | |
max-parallel: 1 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Add .Net 5 Framework | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '5.x' | |
- 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@v4 | |
if: matrix.os == 'ubuntu-latest' | |
with: | |
flags: integration | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
directory: dropbox-sdk-dotnet/Dropbox.Api.Integration.Tests/TestResults/ | |
Linter: | |
strategy: | |
matrix: | |
os: [macos-13, ubuntu-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Add .Net 5 Framework | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '5.x' | |
- name: Run Linter | |
run: | | |
# Install latest dotnet-format | |
dotnet tool install -g dotnet-format --version "5.*" --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/ |