Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into joeriddles/fix-datetime-linter
  • Loading branch information
joeriddles committed Jan 8, 2024
2 parents f1715bb + c3a9cf3 commit 1382ea5
Show file tree
Hide file tree
Showing 9 changed files with 136 additions and 59 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ConvertGuidelinesXmlToMarkdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
XmlFileName: "Guidelines(8th Edition).xml"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
token: ${{ secrets.CI_PAT }}
Expand All @@ -35,7 +35,7 @@ jobs:
echo "${{ steps.diff.outputs.name }}"
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
5.0.x
Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/Deploy
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Deploy

on:
release:
types: [created]
workflow_dispatch:

defaults:
run:
shell: pwsh

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
global-json-file: "./global.json"

- name: Restore dependencies
run: dotnet restore

- name: Set Version
run: |
echo "${{ github.ref }}"
$tagVersion = "${{ github.ref }}".substring(11)
echo "buildVersion=$tagVersion.${{ github.run_number }}" >> $env:GITHUB_ENV
echo "nugetVersion=$tagVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "preRelease=false" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: Pack
if: startsWith(github.ref, 'refs/tags/v')
run: dotnet pack -p:PackageVersion=${{ env.nugetVersion }} --configuration Release -o ${{ github.workspace }}/PackedNuget

- name: Upload Artifacts
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v3
with:
name: NuGet
path: ${{ github.workspace }}/PackedNuget

deploy:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: build-and-test
environment:
name: "Production"
url: "https://www.nuget.org/packages/IntelliTect.Analyzers"
name: Push NuGets

steps:
- name: Download artifact from build job
uses: actions/download-artifact@v3
with:
name: NuGet

- name: Push NuGet
run: |
$tagVersion = "${{ github.ref }}".substring(11)
echo "::set-output name=TAG_VERSION::$tagVersion"
dotnet nuget push IntelliTect.Analyzers.$tagVersion.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate
id: tag-version
55 changes: 30 additions & 25 deletions .github/workflows/dotnetBuild.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,43 @@
name: CodingGuidelines Build
name: Build and Test

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
env:
version: 0.1.10

defaults:
run:
shell: pwsh

jobs:
automerge:
runs-on: ubuntu-latest

permissions:
pull-requests: write
contents: write

steps:
- uses: fastify/[email protected]
with:
use-github-auto-merge: true

build:
runs-on: windows-latest
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup dotnet SDK
uses: actions/setup-dotnet@v3
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
- name: Get Build Information
run: |
pwd
dotnet --info
dotnet --version
- name: Install dependencies
global-json-file: "./global.json"

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build -p:Version="${{ env.version }}" --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- name: dotnet pack
run: dotnet pack -p:Version="${{ env.version }}-ci-${{ github.run_number }}" -o ${{ github.workspace }}
- uses: actions/upload-artifact@v3
with:
path: ${{ github.workspace }}/*.nupkg
name: Intellitect.CodingGuidelines
run: dotnet build -p:ContinuousIntegrationBuild=True --no-restore --configuration Release
4 changes: 2 additions & 2 deletions .github/workflows/manuallyRunXmlToMD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ jobs:
XmlFileName: "Guidelines(8th Edition).xml"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
token: ${{ secrets.CI_PAT }}

- name: Setup .NET Core
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: 5.0.201

Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.2" />
<PackageReference Include="coverlet.collector" Version="3.2.0">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

<PackageReference Include="Microsoft.Build.Locator" Version="1.5.5" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.4.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.4.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.4.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.4.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4-beta1.22559.1">
<PackageReference Include="Microsoft.Build.Locator" Version="1.6.10" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.8.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.8.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.8.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<NoWarn>CA2007,CA1815,CA1303,CA1707,CA1305</NoWarn>
</PropertyGroup>

<ItemGroup>
<Compile Remove="Data\**" />
<Compile Remove="Data\**" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4-beta1.22559.1">
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.4.0" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.0">
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.8.0" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4-beta1.22559.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.4.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.0">
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.8.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
16 changes: 8 additions & 8 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (6.0.6)
activesupport (6.0.6.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
Expand All @@ -16,7 +16,7 @@ GEM
colorator (1.1.0)
commonmarker (0.17.13)
ruby-enum (~> 0.5)
concurrent-ruby (1.1.7)
concurrent-ruby (1.2.2)
dnsruby (1.61.4)
simpleidn (~> 0.1)
em-websocket (0.5.1)
Expand Down Expand Up @@ -147,23 +147,23 @@ GEM
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.3.6)
mini_portile2 (2.8.0)
mini_portile2 (2.8.5)
minima (2.5.1)
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
minitest (5.14.1)
minitest (5.20.0)
multipart-post (2.1.1)
nokogiri (1.13.10)
mini_portile2 (~> 2.8.0)
nokogiri (1.16.0)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
octokit (4.18.0)
faraday (>= 0.9)
sawyer (~> 0.8.0, >= 0.5.3)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (3.1.1)
racc (1.6.1)
racc (1.7.3)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
Expand Down Expand Up @@ -197,7 +197,7 @@ GEM
unf_ext (0.0.7.7)
unicode-display_width (1.7.0)
wdm (0.1.1)
zeitwerk (2.4.0)
zeitwerk (2.6.12)

PLATFORMS
ruby
Expand Down
7 changes: 7 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"sdk": {
"version": "8.0.100",
"rollForward": "minor",
"allowPrerelease": true
}
}

0 comments on commit 1382ea5

Please sign in to comment.