Skip to content

Commit

Permalink
Merge pull request #2997 from moreal/ci/gh-actions/force-items-with-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
moreal authored Nov 12, 2024
2 parents f341a7c + a550baf commit e8917e2
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 3 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,45 @@ jobs:
if [ "$count" -gt 0 ]; then
exit 1
fi
count-no-docs-on-baseref:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
outputs:
count: ${{ steps.count-no-docs.outputs.count }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.base_ref }}
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- id: count-no-docs
run: |
set -ev
count=$(dotnet build -p GenerateDocumentationFile=true -p 'DocumentationFile=docs.xml' -consoleloggerparameters:WarningsOnly | grep -c -E "CS(1573|1591)")
echo "count=$count" >> "$GITHUB_OUTPUT"
count-no-docs-on-headref:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
outputs:
count: ${{ steps.count-no-docs.outputs.count }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- id: count-no-docs
run: |
set -ev
count=$(dotnet build -p GenerateDocumentationFile=true -p 'DocumentationFile=docs.xml' -consoleloggerparameters:WarningsOnly | grep -c -E "CS(1573|1591)")
echo "count=$count" >> "$GITHUB_OUTPUT"
check-items-without-docs-increased:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
needs: [count-no-docs-on-headref, count-no-docs-on-baseref]
steps:
- run: '[ "$BASE_COUNT" -ge "$HEAD_COUNT" ]'
env:
BASE_COUNT: ${{ needs.count-no-docs-on-baseref.outputs.count }}
HEAD_COUNT: ${{ needs.count-no-docs-on-headref.outputs.count }}
3 changes: 2 additions & 1 deletion Lib9c.Abstractions/Lib9c.Abstractions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<OutputPath>.bin</OutputPath>
<IntermediateOutputPath>.obj</IntermediateOutputPath>
<LangVersion>9</LangVersion>
<CodeAnalysisRuleSet>..\Lib9c.Common.ruleset</CodeAnalysisRuleSet>
<VersionPrefix>1.19.0</VersionPrefix>
</PropertyGroup>

Expand Down
5 changes: 5 additions & 0 deletions Lib9c/Lib9c.ruleset → Lib9c.Common.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,9 @@
instead. -->
<Rule Id="S4035" Action="None" />
</Rules>

<Rules AnalyzerId="Microsoft.CodeAnalysis.CSharp" RuleNamespace="Microsoft.CodeAnalysis.CSharp">
<Rule Id="CS1573" Action="Warning" />
<Rule Id="CS1591" Action="Warning" />
</Rules>
</RuleSet>
4 changes: 2 additions & 2 deletions Lib9c/Lib9c.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<NoWarn>$(NoWarn);CS0162;CS8032;CS0618</NoWarn>
<CodeAnalysisRuleSet>Lib9c.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet>..\Lib9c.Common.ruleset</CodeAnalysisRuleSet>
<OutputPath>.bin</OutputPath>
<IntermediateOutputPath>.obj</IntermediateOutputPath>
<RootNamespace>Nekoyume</RootNamespace>
Expand Down

0 comments on commit e8917e2

Please sign in to comment.