Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/move to common build #5

Merged
merged 14 commits into from
Nov 18, 2020
Merged
Show file tree
Hide file tree
Changes from 13 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
106 changes: 104 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,112 @@ indent_size = 4
indent_style = tab
indent_size = 4

[*.{fs,fsx}]
[*.{fs,fsx,yml}]
indent_style = space
indent_size = 4

[*.{md,markdown,json,js,csproj,fsproj,targets}]
[*.{md,markdown,json,js,csproj,fsproj,targets,targets,props}]
indent_style = space
indent_size = 2

# Dotnet code style settings:
[*.{cs,vb}]

# ---
# naming conventions https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-naming-conventions
# currently not supported in Rider/Resharper so not using these for now
# ---

# ---
# language conventions https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#language-conventions

# Sort using and Import directives with System.* appearing first
dotnet_sort_system_directives_first = true

dotnet_style_qualification_for_field = false:error
dotnet_style_qualification_for_property = false:error
dotnet_style_qualification_for_method = false:error
dotnet_style_qualification_for_event = false:error

# Use language keywords instead of framework type names for type references
dotnet_style_predefined_type_for_locals_parameters_members = true:error
dotnet_style_predefined_type_for_member_access = true:error

# Suggest more modern language features when available
dotnet_style_object_initializer = true:error
dotnet_style_collection_initializer = true:error
dotnet_style_explicit_tuple_names = true:error
dotnet_style_prefer_inferred_anonymous_type_member_names = true:error
dotnet_style_prefer_inferred_tuple_names = true:error
dotnet_style_coalesce_expression = true:error
dotnet_style_null_propagation = true:error

dotnet_style_require_accessibility_modifiers = for_non_interface_members:error
dotnet_style_readonly_field = true:error

# CSharp code style settings:
[*.cs]
# Prefer "var" everywhere
csharp_style_var_for_built_in_types = true:error
csharp_style_var_when_type_is_apparent = true:error
csharp_style_var_elsewhere = true:error

csharp_style_expression_bodied_methods = true:error
csharp_style_expression_bodied_constructors = true:error
csharp_style_expression_bodied_operators = true:error
csharp_style_expression_bodied_properties = true:error
csharp_style_expression_bodied_indexers = true:error
csharp_style_expression_bodied_accessors = true:error

# Suggest more modern language features when available
csharp_style_pattern_matching_over_is_with_cast_check = true:error
csharp_style_pattern_matching_over_as_with_null_check = true:error
csharp_style_inlined_variable_declaration = true:error
csharp_style_deconstructed_variable_declaration = true:error
csharp_style_pattern_local_over_anonymous_function = true:error
csharp_style_throw_expression = true:error
csharp_style_conditional_delegate_call = true:error

csharp_prefer_braces = false:warning
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:error

# ---
# formatting conventions https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#formatting-conventions

# Newline settings (Allman yo!)
csharp_new_line_before_open_brace = all:error
csharp_new_line_before_else = true:error
csharp_new_line_before_catch = true:error
csharp_new_line_before_finally = true:error
csharp_new_line_before_members_in_object_initializers = true
# just a suggestion do to our JSON tests that use anonymous types to
# represent json quite a bit (makes copy paste easier).
csharp_new_line_before_members_in_anonymous_types = true:suggestion
csharp_new_line_between_query_expression_clauses = true:error

# Indent
csharp_indent_case_contents = true:error
csharp_indent_switch_labels = true:error
csharp_space_after_cast = false:error
csharp_space_after_keywords_in_control_flow_statements = true:error
csharp_space_between_method_declaration_parameter_list_parentheses = false:error
csharp_space_between_method_call_parameter_list_parentheses = false:error

#Wrap
csharp_preserve_single_line_statements = false:error
csharp_preserve_single_line_blocks = true:error

# Resharper
resharper_csharp_braces_for_lock=required_for_complex
resharper_csharp_braces_for_using=required_for_complex
resharper_csharp_braces_for_while=required_for_complex
resharper_csharp_braces_for_foreach=required_for_complex
resharper_csharp_braces_for_for=required_for_complex
resharper_csharp_braces_for_fixed=required_for_complex
resharper_csharp_braces_for_ifelse=required_for_complex

resharper_csharp_accessor_owner_body=expression_body


resharper_redundant_case_label_highlighting=do_not_show

64 changes: 64 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Always be deploying

on:
pull_request:
paths-ignore:
- 'README.md'
- '.editorconfig'
push:
paths-ignore:
- 'README.md'
- '.editorconfig'
branches:
- master
tags:
- "*.*.*"

jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- run: |
git fetch --prune --unshallow --tags
echo exit code $?
git tag --list
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.201'
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.100'
source-url: https://nuget.pkg.github.com/nullean/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

- run: ./build.sh build -s true
name: Build
- run: ./build.sh test -s true
name: Test
- run: ./build.sh generatepackages -s true
name: Generate local nuget packages
- run: ./build.sh validatepackages -s true
name: "validate *.npkg files that were created"
- run: ./build.sh generateapichanges -s true
name: "Inspect public API changes"

- name: publish to github package repository
if: github.event_name == 'push' && startswith(github.ref, 'refs/heads')
shell: bash
run: |
until dotnet nuget push build/output/*.nupkg -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate --no-symbols true; do echo "Retrying"; sleep 1; done;

- run: ./build.sh generatereleasenotes -s true
name: Generate release notes for tag
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags')
- run: ./build.sh createreleaseongithub -s true --token ${{secrets.GITHUB_TOKEN}}
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags')
name: Create or update release for tag on github

- run: dotnet nuget push build/output/*.nupkg -k ${{secrets.NUGET_ORG_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols true
name: release to nuget.org
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags')
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,19 @@ test-results
test-results/*
*.lib
*.sbr
*.DotSettings
*.DotSettings.user
obj/
[Rr]elease*/
_ReSharper*/
_NCrunch*/
[Tt]est[Rr]esult*

.fake/*
.fake
packages/*
!paket.bootstrapper.exe
paket.exe
paket-files/*.cached

!src/Proc/Embedded/Proc.ControlC.exe

BenchmarkDotNet.Artifacts
build/*
!build/tools
!build/keys
Expand Down Expand Up @@ -84,3 +81,6 @@ project.lock.json
.idea/
*.sln.iml
/src/.vs/restore.dg
# temporary location for doc generation
docs-temp
*.binlog
Loading