Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempting to fix CI for ARM Mac and older dotnet format tool compatbility #360

Merged
merged 26 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
12c5a6d
Attempting to fix CI for ARM Mac and older dotnet format tool compatb…
EliIser May 10, 2024
97d40c3
Adding CI step to install .NET 5
EliIser May 10, 2024
6c3ae33
Fixed copy-pasta typo
EliIser May 10, 2024
efeb6cf
Testing basic dotnet format functionallity in CI
EliIser May 10, 2024
d2c34bb
Testing basic dotnet format functionallity in CI
EliIser May 10, 2024
426e2d3
Testing linter commands on Windows only
EliIser May 13, 2024
cbcd710
Adding some logs to diagnose lint issues
EliIser May 13, 2024
284da73
Attempting to force dotnet tool to use .NET 5
EliIser May 13, 2024
689f0c1
Moving the .NET config one folder up
EliIser May 13, 2024
38f522a
Moving dotnet format installation to local
EliIser May 13, 2024
31fdfb9
Removing local manifests; uninstallating dotnet-format before install…
EliIser May 13, 2024
8aa5b6a
Diagnostic list
EliIser May 13, 2024
18ee263
Moving dotnet-format install to after project resotre
EliIser May 13, 2024
9417ba1
More verbose logs
EliIser May 13, 2024
9f1663c
More diagnostics
EliIser May 13, 2024
767e514
Using dotnet-format instead of dotnet format
EliIser May 13, 2024
03a5757
Cleanup debug stuff for linter
EliIser May 13, 2024
d472883
Adding missing whitespace for linter
EliIser May 13, 2024
c1cc9ae
Updating Codecov upload action
EliIser May 13, 2024
1b133c0
Temporarly disable code coverage upload
EliIser May 13, 2024
8d6669d
Bumping version of Newtonsoft.Json and jQuery.Validation
EliIser May 13, 2024
e873e55
Updating another jQuery.Validation version
EliIser May 13, 2024
3490e08
Restoring Codecov step
EliIser May 14, 2024
dc1d950
Using Codecov token from secrets
EliIser May 14, 2024
366397b
Revert "Updating another jQuery.Validation version"
EliIser May 15, 2024
cfbe93c
Revert "Bumping version of Newtonsoft.Json and jQuery.Validation"
EliIser May 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,38 @@ jobs:
UnitTests:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
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@v1.3.2
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-latest, ubuntu-latest, windows-latest]
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 }}
Expand All @@ -53,22 +62,27 @@ jobs:
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
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-latest, ubuntu-latest, windows-latest]
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 6.0.241801 --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json
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/
dotnet-format --check --fix-whitespace --fix-style warn --fix-analyzers warn dropbox-sdk-dotnet/
12 changes: 1 addition & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,11 @@ You can use [dotnet-format](https://github.com/dotnet/format) to lint from the c

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

### Updating Generated Code

Install PowerShell and execute `./scripts/generate_stone.ps1` to regenerate Stone types.

```sh
git submodule init
git submodule update --remote --recursive
./scripts/generate_stone.ps1
```

### Cutting New Versions (for Dropboxers)

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`.
Expand Down
2 changes: 1 addition & 1 deletion dropbox-sdk-dotnet/Examples/SimpleTest/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ private async Task ChunkUpload(DropboxClient client, string folder, string fileN

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

else
Expand Down
Loading