Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
devantler authored Jul 11, 2024
0 parents commit fb9681c
Show file tree
Hide file tree
Showing 15 changed files with 467 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.cs]
# Rule: Set personal preferences for analyzer diagnostics
csharp_style_expression_bodied_accessors = when_on_single_line
csharp_style_expression_bodied_constructors = when_on_single_line
csharp_style_expression_bodied_indexers = when_on_single_line
csharp_style_expression_bodied_lambdas = when_on_single_line
csharp_style_expression_bodied_local_functions = when_on_single_line
csharp_style_expression_bodied_methods = when_on_single_line
csharp_style_expression_bodied_operators = when_on_single_line
csharp_prefer_braces = when_multiline
csharp_style_namespace_declarations = file_scoped
csharp_style_var_elsewhere = true
csharp_style_var_when_type_is_apparent = true
dotnet_sort_system_directives_first = true
dotnet_style_require_accessibility_modifiers = omit_if_default

[*.{received,verified}.*]
generated_code = true

[tests/**/*Tests.cs]
dotnet_diagnostic.CA1707.severity = none
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @devantler @github-actions[bot]
6 changes: 6 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
23 changes: 23 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended", ":disableDependencyDashboard"],
"flux": {
"fileMatch": [
"^k8s/.+\\.ya?ml$"
]
},
"kubernetes": {
"fileMatch": [
"^k8s/.+\\.ya?ml$"
]
},
"github-actions": {
"enabled": false
},
"minor": {
"automerge": true
},
"patch": {
"automerge": true
}
}
36 changes: 36 additions & 0 deletions .github/workflows/auto-merge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Dependabot auto-merge
on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
auto-approve:
runs-on: ubuntu-latest
permissions:
pull-requests: write
if: github.actor == 'dependabot[bot]'
steps:
- uses: hmarr/auto-approve-action@v4
dependabot:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Approve pull request
run: |
# Use GitHub API to approve the pull request
curl -X POST -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews" \
-d '{"event": "APPROVE"}'
- name: Enable auto-merge for Dependabot PRs
if: steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type != 'version-update:semver-major'
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
31 changes: 31 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish
on:
push:
branches: [main]
workflow_dispatch:

jobs:
publish-github:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up .NET SDK
uses: actions/setup-dotnet@v4.0.0
- name: Pack
run: dotnet pack --configuration Release
- name: Add GitHub Packages as NuGet Source
run: dotnet nuget add source --username devantler --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/devantler/index.json"
- name: Push to GitHub Packages
run: dotnet nuget push src/**/*.nupkg --source "github" --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
publish-nuget:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up .NET SDK
uses: actions/setup-dotnet@v4.0.0
- name: Pack
run: dotnet pack --configuration Release
- name: Push to NuGet
run: dotnet nuget push src/**/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate
29 changes: 29 additions & 0 deletions .github/workflows/readme-tree.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Readme Tree

on:
push:
branches: [main]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
tree:
runs-on: ubuntu-latest
name: readme-tree
steps:
- uses: actions/checkout@v4
- name: Create README Tree
uses: RavelloH/readme-tree@v1.1.0
with:
showdirectoryname: "yes"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
branch: update-readme-tree
commit-message: Update README Tree
title: Update README Tree
body: This PR includes new updates to the README Tree.
labels: chore
20 changes: 20 additions & 0 deletions .github/workflows/sync-labels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Sync labels
on:
schedule:
- cron: "0 7 * * 1"
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
sync:
name: Run EndBug/label-sync
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: EndBug/label-sync@v2
with:
config-file: "https://raw.githubusercontent.com/devantler/.github/main/.github/labels.yaml"
delete-other-labels: true
34 changes: 34 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test

on:
pull_request:
# Added 'edited' temporarily, as there currently is no trigger for when the base branch is updated.
# https://github.com/orgs/community/discussions/64119
types: [opened, synchronize, reopened, ready_for_review, closed, edited]
branches: main
push:
branches: main
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- name: 📑 Checkout
uses: actions/checkout@v4
- name: ⚙️ Setup .NET
uses: actions/setup-dotnet@v4
- name: 🧪 Test
run: dotnet test --collect:"XPlat Code Coverage"
- name: 📄 Upload Code Coverage to CodeCov
uses: codecov/codecov-action@v4
with:
files: tests/**/TestResults/**/coverage.cobertura.xml
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/todos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "TODOs"
on:
push:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- uses: "alstr/todo-to-issue-action@v5"
env:
AUTO_ASSIGN: true
LABEL: chore
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# MacOS
.DS_Store

# .NET
bin
obj
*.received.*
**/TestResults/

# Temporary files
*.tmp*
Loading

0 comments on commit fb9681c

Please sign in to comment.