Skip to content
This repository was archived by the owner on Jun 30, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ dotnet_style_require_accessibility_modifiers = omit_if_default:error
dotnet_diagnostic.IDE0040.severity = error

[*.cs]
# Top-level files are definitely OK
csharp_using_directive_placement = outside_namespace:silent
csharp_style_namespace_declarations = block_scoped:silent
csharp_prefer_simple_using_statement = true:suggestion
csharp_prefer_braces = true:silent

# Prefer "var" everywhere
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
Expand Down Expand Up @@ -87,3 +93,17 @@ csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true

# Test settings
[**/*Tests*/**{.cs,.vb}]
# xUnit1013: Public method should be marked as test. Allows using records as test classes
dotnet_diagnostic.xUnit1013.severity = none

# CS9113: Parameter is unread (usually, ITestOutputHelper)
dotnet_diagnostic.CS9113.severity = none

# Default severity for analyzer diagnostics with category 'Style'
dotnet_analyzer_diagnostic.category-Style.severity = none

# VSTHRD200: Use "Async" suffix for async methods
dotnet_diagnostic.VSTHRD200.severity = none
10 changes: 1 addition & 9 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,4 @@ updates:
- package-ecosystem: nuget
directory: /
schedule:
interval: weekly
ignore:
- dependency-name: "Microsoft.CodeAnalysis.Common"
- dependency-name: "Microsoft.CodeAnalysis.CSharp"
- dependency-name: "Microsoft.CodeAnalysis.CSharp.Features"
- dependency-name: "Microsoft.CodeAnalysis.CSharp.Workspaces"
- dependency-name: "Microsoft.CodeAnalysis.VisualBasic"
- dependency-name: "Microsoft.Bcl.AsyncInterfaces"
- dependency-name: "Microsoft.Bcl.HashCode"
interval: daily
32 changes: 32 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
changelog:
exclude:
labels:
- bydesign
- dependencies
- duplicate
- question
- invalid
- wontfix
- need info
- docs
- techdebt
authors:
- devlooped-bot
- dependabot
- github-actions
categories:
- title: ✨ Implemented enhancements
labels:
- enhancement
- title: 🐛 Fixed bugs
labels:
- bug
- title: 📝 Documentation updates
labels:
- docs
- title: 🔨 Other
labels:
- '*'
exclude:
labels:
- dependencies
132 changes: 39 additions & 93 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,49 @@ name: build
on:
workflow_dispatch:
push:
branches: [ main, dev, 'feature/*', 'rel/*' ]
branches: [ main, dev, 'dev/*', 'feature/*', 'rel/*' ]
paths-ignore:
- changelog.md
- code-of-conduct.md
- security.md
- support.md
- readme.md
pull_request:
types: [opened, synchronize, reopened]

env:
DOTNET_NOLOGO: true
VersionPrefix: 42.42.${{ github.run_number }}
VersionLabel: ${{ github.ref }}

defaults:
run:
shell: bash

jobs:
dotnet-format:
os-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.lookup.outputs.matrix }}
steps:
- name: 🤘 checkout
uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0

- name: ✓ ensure format

- name: 🔎 lookup
id: lookup
shell: pwsh
run: |
dotnet tool update -g dotnet-format --version 5.0.*
dotnet restore
dotnet format --check -v:diag
$path = './.github/workflows/os-matrix.json'
$os = if (test-path $path) { cat $path } else { '["ubuntu-latest"]' }
echo "matrix=$os" >> $env:GITHUB_OUTPUT

build:
needs: os-matrix
name: build-${{ matrix.os }}
needs: dotnet-format
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
os: ${{ fromJSON(needs.os-matrix.outputs.matrix) }}
steps:
- name: 🤘 checkout
uses: actions/checkout@v2
Expand All @@ -47,102 +56,39 @@ jobs:
fetch-depth: 0

- name: 🙏 build
run: dotnet build -m:1 -bl:build.binlog -p:VersionLabel="$GITHUB_REF.$GITHUB_RUN_NUMBER" -p:RepositoryBranch=${GITHUB_REF#refs/*/}
run: dotnet build -m:1

- name: ⚙ GNU grep
if: matrix.os == 'macOS-latest'
run: |
brew install grep
echo 'export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"' >> .bash_profile

- name: 🧪 test
run: dotnet test --no-build -m:1 --blame-hang --blame-hang-timeout 5m -d $GITHUB_WORKSPACE/logs/${{ matrix.os }}.txt -r $GITHUB_WORKSPACE/logs
uses: ./.github/workflows/test

- name: 📦 pack
run: dotnet pack -m:1 -bl:pack.binlog -p:VersionLabel="$GITHUB_REF.$GITHUB_RUN_NUMBER" -p:RepositoryBranch=${GITHUB_REF#refs/*/}
run: dotnet pack -m:1

- name: 🔼 packages
uses: actions/upload-artifact@v2
with:
name: bin
path: bin/*.nupkg

# Only push CI package to sleet feed if building on ubuntu (fastest)
- name: 🚀 sleet
env:
SLEET_CONNECTION: ${{ secrets.SLEET_CONNECTION }}
if: matrix.os == 'ubuntu-latest' && env.SLEET_CONNECTION != ''
if: env.SLEET_CONNECTION != ''
run: |
dotnet tool install -g --version 4.0.18 sleet
sleet push bin --config none -f --verbose -p "SLEET_FEED_CONTAINER=nuget" -p "SLEET_FEED_CONNECTIONSTRING=${{ secrets.SLEET_CONNECTION }}" -p "SLEET_FEED_TYPE=azure" || echo "No packages found"

acceptance:
name: acceptance-${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: build
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- name: 🤘 checkout
uses: actions/checkout@v2

- name: 🔽 packages
uses: actions/download-artifact@v2
with:
name: bin
path: bin

- name: 🧪 test
run: dotnet test -p:VersionLabel="$GITHUB_REF.$GITHUB_RUN_NUMBER"
working-directory: src/Acceptance

preview:
defaults:
run:
shell: pwsh
needs: dotnet-format
runs-on: windows-latest

dotnet-format:
runs-on: ubuntu-latest
steps:
- name: 🤘 checkout
uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0

# > VS Preview
- name: 🔽 dotnet-vs
run: dotnet tool update -g dotnet-vs
- name: 🔽 vs preview
run: vs install preview --quiet +Microsoft.VisualStudio.Component.ManagedDesktop.Core +Microsoft.NetCore.Component.DevelopmentTools
- name: ≥ msbuild
run: echo "$(vs where preview --prop=InstallationPath)\MSBuild\Current\Bin" >> $env:GITHUB_PATH
# < VS Preview

- name: ⚙ curl
- name: ✓ ensure format
run: |
iwr -useb get.scoop.sh | iex
scoop install curl
- name: 🔍 status for PR
if: ${{ github.event.pull_request.head.sha }}
run: echo "STATUS_SHA=${{ github.event.pull_request.head.sha }}" >> $env:GITHUB_ENV

- name: 🔍 status for branch
if: ${{ !github.event.pull_request.head.sha }}
run: echo "STATUS_SHA=$($env:GITHUB_SHA)" >> $env:GITHUB_ENV

- name: ⌛ wait on build
env:
CHECK: build-windows-latest
SHA: ${{ env.STATUS_SHA }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./.github/workflows/wait-status.ps1

- name: ⌛ wait on acceptance
env:
CHECK: acceptance-windows-latest
SHA: ${{ env.STATUS_SHA }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./.github/workflows/wait-status.ps1

- name: 🔽 packages
uses: actions/download-artifact@v2
with:
name: bin
path: bin

- name: 🧪 test
run: msbuild -r -t:build,test -p:TargetFramework=net472 -p:VersionLabel="$($env:GITHUB_REF).$($env:GITHUB_RUN_NUMBER)"
working-directory: src/Acceptance
dotnet format whitespace --verify-no-changes -v:diag --exclude ~/.nuget
dotnet format style --verify-no-changes -v:diag --exclude ~/.nuget
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
usernames-as-github-logins=true
header-label=
issues_wo_labels=true
pr_wo_labels=true
exclude-labels=dependencies,duplicate,question,invalid,wontfix
exclude-labels=bydesign,dependencies,duplicate,question,invalid,wontfix,need info,docs
enhancement-label=:sparkles: Implemented enhancements:
bugs-label=:bug: Fixed bugs:
issues-label=:hammer: Other:
pr-label=:twisted_rightwards_arrows: Merged:
unreleased=false
33 changes: 18 additions & 15 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,39 @@
name: changelog
on:
workflow_dispatch:
release:
types: [released]

env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}

jobs:
changelog:
runs-on: ubuntu-latest
steps:
- name: 🔍 GH_TOKEN
if: env.GH_TOKEN == ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: echo "GH_TOKEN=${GITHUB_TOKEN}" >> $GITHUB_ENV

- name: 🤖 defaults
uses: devlooped/actions-bot@v1
with:
name: ${{ secrets.BOT_NAME }}
email: ${{ secrets.BOT_EMAIL }}
gh_token: ${{ secrets.GH_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: 🤘 checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: main
token: ${{ env.GH_TOKEN }}

- name: ⚙ ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.3

- name: ⚙ changelog
uses: faberNovel/github-changelog-generator-action@master
with:
options: --token ${{ secrets.GITHUB_TOKEN }} --o changelog.md
run: |
gem install github_changelog_generator
github_changelog_generator --user ${GITHUB_REPOSITORY%/*} --project ${GITHUB_REPOSITORY##*/} --token $GH_TOKEN --o changelog.md --config-file .github/workflows/changelog.config

- name: 🚀 changelog
run: |
git config --local user.name github-actions
git config --local user.email github-actions@github.com
git add changelog.md
(git commit -m "🖉 Update changelog with ${GITHUB_REF#refs/*/}" && git push) || echo "Done"
(git commit -m "🖉 Update changelog with ${GITHUB_REF#refs/*/}" && git push) || echo "Done"
Loading