Skip to content

Commit 0ff5668

Browse files
eli-iserEliIser
andauthored
Attempting to fix CI for ARM Mac and older dotnet format tool compatbility (#360)
* Attempting to fix CI for ARM Mac and older dotnet format tool compatbility * Adding CI step to install .NET 5 * Fixed copy-pasta typo * Testing basic dotnet format functionallity in CI * Testing basic dotnet format functionallity in CI * Testing linter commands on Windows only * Adding some logs to diagnose lint issues * Attempting to force dotnet tool to use .NET 5 * Moving the .NET config one folder up * Moving dotnet format installation to local * Removing local manifests; uninstallating dotnet-format before installing our version * Diagnostic list * Moving dotnet-format install to after project resotre * More verbose logs * More diagnostics * Using dotnet-format instead of dotnet format * Cleanup debug stuff for linter * Adding missing whitespace for linter * Updating Codecov upload action * Temporarly disable code coverage upload * Bumping version of Newtonsoft.Json and jQuery.Validation * Updating another jQuery.Validation version * Restoring Codecov step * Using Codecov token from secrets * Revert "Updating another jQuery.Validation version" This reverts commit e873e55. * Revert "Bumping version of Newtonsoft.Json and jQuery.Validation" This reverts commit 8d6669d. --------- Co-authored-by: Eli Iser <eiser@dropbox.com>
1 parent 7be578c commit 0ff5668

3 files changed

Lines changed: 23 additions & 19 deletions

File tree

.github/workflows/ci.yml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,38 @@ jobs:
1111
UnitTests:
1212
strategy:
1313
matrix:
14-
os: [macos-latest, ubuntu-latest, windows-latest]
14+
os: [macos-13, ubuntu-latest, windows-latest]
1515
runs-on: ${{ matrix.os }}
1616
steps:
1717
- uses: actions/checkout@v2
18+
- name: Add .Net 5 Framework
19+
uses: actions/setup-dotnet@v4
20+
with:
21+
dotnet-version: '5.x'
1822
- name: Run Unit Tests
1923
# We don't have a good cross-platform way of splitting long lines
2024
run: |
2125
dotnet test dropbox-sdk-dotnet/Dropbox.Api.Unit.Tests --collect:"XPlat Code Coverage" -- 'DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.ExcludeByFile=**/Generated/**/*.cs'
2226
- name: Publish Coverage
23-
uses: codecov/codecov-action@v1.3.2
27+
uses: codecov/codecov-action@v4
2428
if: matrix.os == 'ubuntu-latest'
2529
with:
2630
flags: unit
31+
token: ${{ secrets.CODECOV_TOKEN }}
2732
fail_ci_if_error: true
2833
directory: dropbox-sdk-dotnet/Dropbox.Api.Unit.Tests/TestResults/
2934
IntegrationTests:
3035
strategy:
3136
matrix:
32-
os: [macos-latest, ubuntu-latest, windows-latest]
37+
os: [macos-13, ubuntu-latest, windows-latest]
3338
max-parallel: 1
3439
runs-on: ${{ matrix.os }}
3540
steps:
3641
- uses: actions/checkout@v2
42+
- name: Add .Net 5 Framework
43+
uses: actions/setup-dotnet@v4
44+
with:
45+
dotnet-version: '5.x'
3746
- name: Test Legacy User
3847
env:
3948
DROPBOX_INTEGRATION_appKey: ${{ secrets.LEGACY_APP_KEY }}
@@ -53,22 +62,27 @@ jobs:
5362
run: |
5463
dotnet test dropbox-sdk-dotnet/Dropbox.Api.Integration.Tests --collect:"XPlat Code Coverage" -- 'DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.ExcludeByFile=**/Generated/**/*.cs'
5564
- name: Publish Coverage
56-
uses: codecov/codecov-action@v1.3.2
65+
uses: codecov/codecov-action@v4
5766
if: matrix.os == 'ubuntu-latest'
5867
with:
5968
flags: integration
69+
token: ${{ secrets.CODECOV_TOKEN }}
6070
fail_ci_if_error: true
6171
directory: dropbox-sdk-dotnet/Dropbox.Api.Integration.Tests/TestResults/
6272
Linter:
6373
strategy:
6474
matrix:
65-
os: [macos-latest, ubuntu-latest, windows-latest]
75+
os: [macos-13, ubuntu-latest, windows-latest]
6676
runs-on: ${{ matrix.os }}
6777
steps:
6878
- uses: actions/checkout@v2
79+
- name: Add .Net 5 Framework
80+
uses: actions/setup-dotnet@v4
81+
with:
82+
dotnet-version: '5.x'
6983
- name: Run Linter
7084
run: |
7185
# Install latest dotnet-format
72-
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
86+
dotnet tool install -g dotnet-format --version "5.*" --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json
7387
dotnet restore dropbox-sdk-dotnet/
74-
dotnet format --check --fix-whitespace --fix-style warn --fix-analyzers warn dropbox-sdk-dotnet/
88+
dotnet-format --check --fix-whitespace --fix-style warn --fix-analyzers warn dropbox-sdk-dotnet/

CONTRIBUTING.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,11 @@ You can use [dotnet-format](https://github.com/dotnet/format) to lint from the c
4949

5050
```sh
5151
# Install a recent dotnet-format build
52-
dotnet tool install -g dotnet-format --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json
52+
dotnet tool install -g dotnet-format --version "5.*" --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json
5353
# Optionally omit `--check` to auto-fix lint issues
5454
dotnet format --check --fix-whitespace --fix-style info --fix-analyzers info dropbox-sdk-dotnet/
5555
```
5656

57-
### Updating Generated Code
58-
59-
Install PowerShell and execute `./scripts/generate_stone.ps1` to regenerate Stone types.
60-
61-
```sh
62-
git submodule init
63-
git submodule update --remote --recursive
64-
./scripts/generate_stone.ps1
65-
```
66-
6757
### Cutting New Versions (for Dropboxers)
6858

6959
To cut a new version, create a new GitHub release using `vX.Y.Z` as the tag name. GitHub Actions will automatically build the SDK and publish it to NuGet as version `X.Y.Z`.

dropbox-sdk-dotnet/Examples/SimpleTest/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ private async Task ChunkUpload(DropboxClient client, string folder, string fileN
500500

501501
if (idx == numChunks - 1)
502502
{
503-
await client.Files.UploadSessionFinishAsync(cursor:cursor, commit:new CommitInfo(folder + "/" + fileName), body:memStream);
503+
await client.Files.UploadSessionFinishAsync(cursor: cursor, commit: new CommitInfo(folder + "/" + fileName), body: memStream);
504504
}
505505

506506
else

0 commit comments

Comments
 (0)