-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
237 additions
and
17 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Build and Test | ||
|
||
on: | ||
pull_request: | ||
|
||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build-test: | ||
|
||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: GITHUB CONTEXT | ||
env: | ||
GITHUB_CONTEXT: ${{ toJson(github) }} | ||
run: echo "$GITHUB_CONTEXT" | ||
|
||
- name: Commit Lint | ||
uses: wagoid/commitlint-github-action@master | ||
with: | ||
failOnWarnings: true | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: '8.0.x' | ||
|
||
- name: Build Framework | ||
run: | | ||
dotnet build LoadShedding.sln -c Release | ||
- name: UnitTests | ||
run: | | ||
dotnet test LoadShedding.sln --filter Category=Unit -c Release --logger "console;verbosity=detailed" | ||
- name: IntegrationTests | ||
run: | | ||
dotnet test LoadShedding.sln --filter Category=Integration -c Release --logger "console;verbosity=detailed" | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
name: Monthly Metrics | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
dates: | ||
required: false | ||
schedule: | ||
- cron: '3 2 1 * *' | ||
|
||
permissions: | ||
issues: write | ||
pull-requests: read | ||
|
||
jobs: | ||
run: | ||
name: Calculate Metrics | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Get dates for last month | ||
id: get-dates | ||
shell: bash | ||
run: | | ||
# Calculate the first day of the previous month | ||
first_day=$(date -d "last month" +%Y-%m-01) | ||
# Calculate the last day of the previous month | ||
last_day=$(date -d "$first_day +1 month -1 day" +%Y-%m-%d) | ||
#Set an environment variable with the date range | ||
echo "$first_day..$last_day" | ||
echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV" | ||
- name: Use input dates | ||
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.dates != '' }} | ||
shell: bash | ||
run: | | ||
echo "${{github.event.inputs.dates}}" | ||
echo "last_month=${{github.event.inputs.dates}}" >> "$GITHUB_ENV" | ||
- name: Run issue-metrics tool for items opened last month | ||
id: opened-metrics | ||
uses: github/issue-metrics@v2 | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SEARCH_QUERY: 'repo:farfetch/loadshedding created:${{ env.last_month }} -reason:"not planned"' | ||
|
||
- name: Upload for opened items | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: items-opened | ||
path: ./issue_metrics.md | ||
|
||
- name: Run issue-metrics tool for items closed last month | ||
id: closed-metrics | ||
uses: github/issue-metrics@v2 | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SEARCH_QUERY: 'repo:farfetch/loadshedding closed:${{ env.last_month }} -reason:"not planned"' | ||
|
||
- name: Upload for closed items | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: items-closed | ||
path: ./issue_metrics.md | ||
|
||
- name: Run issue-metrics tool for discussions opened last month | ||
id: opened-discussions-metrics | ||
uses: github/issue-metrics@v2 | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SEARCH_QUERY: 'repo:farfetch/loadshedding type:discussions created:${{ env.last_month }} -reason:"not planned"' | ||
|
||
- name: Upload for opened discussions | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: discussions-opened | ||
path: ./issue_metrics.md | ||
|
||
- name: Run issue-metrics tool for discussions closed last month | ||
id: closed-discussions-metrics | ||
uses: github/issue-metrics@v2 | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SEARCH_QUERY: 'repo:farfetch/loadshedding type:discussions closed:${{ env.last_month }} -reason:"not planned"' | ||
|
||
- name: Upload for closed discussions | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: discussions-closed | ||
path: ./issue_metrics.md |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Publish | ||
|
||
on: | ||
release: | ||
types: [ published ] | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: '8.0.x' | ||
|
||
- name: Pack | ||
run: dotnet pack ./LoadShedding.sln -c Release /p:Version=${{ github.event.release.tag_name }} -o ./drop | ||
|
||
- name: Publish | ||
run: dotnet nuget push ./drop/**/*.nupkg -k ${{ secrets.NUGET_PUBLISH_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate | ||
|
||
- name: Print Version | ||
run: echo ${{ github.event.release.tag_name }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<LangVersion>10.0</LangVersion> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
<IncludeSymbols>true</IncludeSymbols> | ||
<SymbolPackageFormat>snupkg</SymbolPackageFormat> | ||
<PublishRepositoryUrl>true</PublishRepositoryUrl> | ||
<Authors>Farfetch</Authors> | ||
<Company>Farfetch</Company> | ||
<Product>LoadShedding</Product> | ||
<PackageProjectUrl>https://github.com/Farfetch/loadshedding</PackageProjectUrl> | ||
<RepositoryUrl>https://github.com/Farfetch/loadshedding</RepositoryUrl> | ||
<RepositoryType>git</RepositoryType> | ||
<license>https://github.com/Farfetch/loadshedding/blob/master/LICENSE</license> | ||
<PackageLicenseExpression>MIT</PackageLicenseExpression> | ||
<PackageIconUrl>https://raw.githubusercontent.com/Farfetch/.github/master/images/fuse-logo-128.png</PackageIconUrl> | ||
<PackageTags>loadshedding</PackageTags> | ||
<CodeAnalysisRuleSet>$([MSBuild]::GetPathOfFileAbove('StyleCopAnalyzersDefault.ruleset'))</CodeAnalysisRuleSet> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/> | ||
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<AdditionalFiles Include="$([MSBuild]::GetPathOfFileAbove('stylecop.json'))" Link="stylecop.json" /> | ||
</ItemGroup> | ||
|
||
</Project> |
File renamed without changes.
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
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
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<Project> | ||
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../src'))" /> | ||
|
||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectDirectory)/../Traits.cs" Link="Properties/Traits.cs"/> | ||
<AdditionalFiles Include="..\..\..\stylecop.json" Link="stylecop.json" /> | ||
</ItemGroup> | ||
</Project> |
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
2 changes: 1 addition & 1 deletion
2
...arfetch.LoadShedding.IntegrationTests/Tests/Limiters/AdaptativeConcurrencyLimiterTests.cs
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
using Xunit; | ||
|
||
[assembly: AssemblyTrait("Category", "Integration")] |
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
2 changes: 1 addition & 1 deletion
2
...sts/Farfetch.LoadShedding.AspNetCore.Tests/Configurators/LoadSheddingConfiguratorTests.cs
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
2 changes: 1 addition & 1 deletion
2
....LoadShedding.AspNetCore.Tests/Middlewares/AdaptativeConcurrencyLimiterMiddlewareTests.cs
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
2 changes: 1 addition & 1 deletion
2
...it-tests/Farfetch.LoadShedding.AspNetCore.Tests/Resolvers/DefaultPriorityResolverTests.cs
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
2 changes: 1 addition & 1 deletion
2
...t-tests/Farfetch.LoadShedding.AspNetCore.Tests/Resolvers/EndpointPriorityResolverTests.cs
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
2 changes: 1 addition & 1 deletion
2
...tests/Farfetch.LoadShedding.AspNetCore.Tests/Resolvers/HttpHeaderPriorityResolverTests.cs
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
2 changes: 1 addition & 1 deletion
2
tests/unit-tests/Farfetch.LoadShedding.Tests/Builders/AdaptativeLimiterBuilderTests.cs
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
2 changes: 1 addition & 1 deletion
2
tests/unit-tests/Farfetch.LoadShedding.Tests/Calculators/GradientLimitCalculatorTests.cs
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
2 changes: 1 addition & 1 deletion
2
tests/unit-tests/Farfetch.LoadShedding.Tests/Calculators/SquareRootQueueCalculatorTests.cs
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
2 changes: 1 addition & 1 deletion
2
tests/unit-tests/Farfetch.LoadShedding.Tests/Configurations/ConcurrencyContextTests.cs
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
2 changes: 1 addition & 1 deletion
2
tests/unit-tests/Farfetch.LoadShedding.Tests/Configurations/ConcurrencyOptionsTests.cs
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
2 changes: 1 addition & 1 deletion
2
tests/unit-tests/Farfetch.LoadShedding.Tests/Limiters/AdaptativeConcurrencyLimiterTests.cs
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
2 changes: 1 addition & 1 deletion
2
tests/unit-tests/Farfetch.LoadShedding.Tests/Measures/RTTMeasuresTests.cs
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
2 changes: 1 addition & 1 deletion
2
tests/unit-tests/Farfetch.LoadShedding.Tests/Tasks/TaskItemTests.cs
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
2 changes: 1 addition & 1 deletion
2
tests/unit-tests/Farfetch.LoadShedding.Tests/Tasks/TaskManagerTests.cs
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
2 changes: 1 addition & 1 deletion
2
tests/unit-tests/Farfetch.LoadShedding.Tests/Tasks/TaskQueueTests.cs
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
using Xunit; | ||
|
||
[assembly: AssemblyTrait("Category", "Unit")] |