Skip to content

Commit

Permalink
Removed NuGet Cache. (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
DamienDennehy committed Aug 15, 2020
1 parent 7d24f8b commit 1612f21
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 27 deletions.
25 changes: 6 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
SONAR_TOKEN: ${{secrets.SONAR_TOKEN}}
SONAR_PROJECT_KEY: ImgurAPI
SONAR_PROJECT_NAME: Imgur.API
SONAR_PROJECT_NAME: Imgur.API

steps:
- name: Checkout
Expand All @@ -59,14 +59,6 @@ jobs:

- name: Setup SonarScanner
run: dotnet tool install --global dotnet-sonarscanner --version 4.10.0

- name: Setup NuGet Cache
uses: actions/cache@v2
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-

- name: Restore
run: dotnet restore --use-lock-file
Expand Down Expand Up @@ -110,23 +102,18 @@ jobs:
DOTNET_NOLOGO: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true

steps:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.301
source-url: https://nuget.pkg.github.com/DamienDennehy/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

steps:
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
name: ubuntu-latest
path: ./artifacts

- name: Add GitHub Packages Source
run: dotnet nuget add source https://nuget.pkg.github.com/DamienDennehy/index.json --name GitHub --username DamienDennehy --password ${{secrets.GITHUB_TOKEN}} --store-password-in-clear-text

- name: Push to GitHub Packages
run: dotnet nuget push .\artifacts\**\*.nupkg --skip-duplicate --no-symbols true
run: dotnet nuget push .\artifacts\**\*.nupkg --source GitHub --skip-duplicate --no-symbols true
env:
DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLE: false

Expand Down
16 changes: 8 additions & 8 deletions tests/Imgur.API.Tests/AuthenticationTests/ApiClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void SetOAuth2Token_WithNullAccessToken_ThrowsArgumentException()
AccessToken = null,
AccountId = (int)DateTime.Now.Ticks,
AccountUsername = Guid.NewGuid().ToString(),
ExpiresIn = DateTime.Now.Minute,
ExpiresIn = (int)DateTime.Now.Ticks,
RefreshToken = Guid.NewGuid().ToString(),
TokenType = Guid.NewGuid().ToString()
};
Expand All @@ -84,7 +84,7 @@ public void SetOAuth2Token_WithNullAccountId_ThrowsArgumentException()
AccessToken = Guid.NewGuid().ToString(),
AccountId = 0,
AccountUsername = Guid.NewGuid().ToString(),
ExpiresIn = DateTime.Now.Minute,
ExpiresIn = (int)DateTime.Now.Ticks,
RefreshToken = Guid.NewGuid().ToString(),
TokenType = Guid.NewGuid().ToString()
};
Expand All @@ -107,7 +107,7 @@ public void SetOAuth2Token_WithNullAccountUsername_ThrowsArgumentException()
AccessToken = Guid.NewGuid().ToString(),
AccountId = (int)DateTime.Now.Ticks,
AccountUsername = null,
ExpiresIn = DateTime.Now.Minute,
ExpiresIn = (int)DateTime.Now.Ticks,
RefreshToken = Guid.NewGuid().ToString(),
TokenType = Guid.NewGuid().ToString()
};
Expand Down Expand Up @@ -153,7 +153,7 @@ public void SetOAuth2Token_WithNullRefreshToken_ThrowsArgumentException()
AccessToken = Guid.NewGuid().ToString(),
AccountId = (int)DateTime.Now.Ticks,
AccountUsername = Guid.NewGuid().ToString(),
ExpiresIn = DateTime.Now.Minute,
ExpiresIn = (int)DateTime.Now.Ticks,
RefreshToken = null,
TokenType = Guid.NewGuid().ToString()
};
Expand All @@ -176,7 +176,7 @@ public void SetOAuth2Token_WithNullTokenType_ThrowsArgumentException()
AccessToken = Guid.NewGuid().ToString(),
AccountId = (int)DateTime.Now.Ticks,
AccountUsername = Guid.NewGuid().ToString(),
ExpiresIn = DateTime.Now.Minute,
ExpiresIn = (int)DateTime.Now.Ticks,
RefreshToken = Guid.NewGuid().ToString(),
TokenType = null
};
Expand All @@ -199,7 +199,7 @@ public void OAuth2Token_SetByClientIdConstructor_AreSame()
AccessToken = Guid.NewGuid().ToString(),
AccountId = (int)DateTime.Now.Ticks,
AccountUsername = Guid.NewGuid().ToString(),
ExpiresIn = DateTime.Now.Minute,
ExpiresIn = (int)DateTime.Now.Ticks,
RefreshToken = Guid.NewGuid().ToString(),
TokenType = Guid.NewGuid().ToString()
};
Expand All @@ -217,7 +217,7 @@ public void OAuth2Token_SetBySetOAuth2Token_AreSame()
AccessToken = Guid.NewGuid().ToString(),
AccountId = (int)DateTime.Now.Ticks,
AccountUsername = Guid.NewGuid().ToString(),
ExpiresIn = DateTime.Now.Minute,
ExpiresIn = (int)DateTime.Now.Ticks,
RefreshToken = Guid.NewGuid().ToString(),
TokenType = Guid.NewGuid().ToString()
};
Expand All @@ -237,7 +237,7 @@ public void OAuth2Token_SetBySetOAuth2Token_Null()
AccessToken = Guid.NewGuid().ToString(),
AccountId = (int)DateTime.Now.Ticks,
AccountUsername = Guid.NewGuid().ToString(),
ExpiresIn = DateTime.Now.Minute,
ExpiresIn = (int)DateTime.Now.Ticks,
RefreshToken = Guid.NewGuid().ToString(),
TokenType = Guid.NewGuid().ToString()
};
Expand Down

0 comments on commit 1612f21

Please sign in to comment.