-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 99856ce
Showing
19 changed files
with
1,161 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Error Annotation | ||
description: Error Annotation | ||
|
||
inputs: | ||
message: | ||
description: "Message to Display" | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/github-script@v7.0.1 | ||
with: | ||
script: | | ||
var message = '${{ inputs.message }}'; | ||
message = message.replace(/(\r\n|\n|\r)/gm, ''); | ||
core.error(message); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Notice Annotation | ||
description: Notice Annotation | ||
|
||
inputs: | ||
message: | ||
description: "Message to Display" | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/github-script@v7.0.1 | ||
with: | ||
script: | | ||
var message = '${{ inputs.message }}'; | ||
message = message.replace(/(\r\n|\n|\r)/gm, ''); | ||
core.notice(message); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Warning Annotation | ||
description: Warning Annotation | ||
|
||
inputs: | ||
message: | ||
description: "Message to Display" | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/github-script@v7.0.1 | ||
with: | ||
script: | | ||
var message = '${{ inputs.message }}'; | ||
message = message.replace(/(\r\n|\n|\r)/gm, ''); | ||
core.warning(message); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Exit Code | ||
description: Exit Code | ||
|
||
inputs: | ||
code: | ||
description: "Exit Code Number (ensure it is unique across all workflows/actions)" | ||
required: true | ||
message: | ||
description: "Exit Message" | ||
required: false | ||
default: '' | ||
level: | ||
description: "Annotation Level (Error, Warning, Debug, Notice)" | ||
default: error | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- id: createMessage | ||
uses: actions/github-script@v7.0.1 | ||
with: | ||
result-encoding: string | ||
script: > | ||
return '[Exit Code: ${{ inputs.code }}] ${{ inputs.message }} | Note: Search for "code: ${{ inputs.code }}" in the .github/ directory to find the source of this error' | ||
- uses: ./.github/actions/tools/annotation/error | ||
if: inputs.level == 'error' | ||
with: | ||
message: ${{ steps.createMessage.outputs.result }} | ||
|
||
- uses: ./.github/actions/tools/annotation/warning | ||
if: inputs.level == 'warning' | ||
with: | ||
message: ${{ steps.createMessage.outputs.result }} | ||
|
||
- uses: ./.github/actions/tools/annotation/debug | ||
if: inputs.level == 'debug' | ||
with: | ||
message: ${{ steps.createMessage.outputs.result }} | ||
|
||
- uses: ./.github/actions/tools/annotation/notice | ||
if: inputs.level == 'notice' | ||
with: | ||
message: ${{ steps.createMessage.outputs.result }} | ||
|
||
- shell: cmd | ||
run: exit ${{ inputs.code }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
version: 2 | ||
|
||
updates: | ||
- package-ecosystem: github-actions | ||
directory: "/" | ||
commit-message: | ||
prefix: "(dependabot)" | ||
reviewers: | ||
- "${{ secrets.GHA_REVIEWER }}" | ||
schedule: | ||
interval: monthly | ||
|
||
- package-ecosystem: nuget | ||
directory: "/" | ||
commit-message: | ||
prefix: "(dependabot)" | ||
reviewers: | ||
- "${{ secrets.NUGET_REVIEWER }}" | ||
schedule: | ||
interval: monthly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"id": 876151, | ||
"name": "TJC NuGet Package Ruleset", | ||
"target": "branch", | ||
"source_type": "Repository", | ||
"source": "TJC-Tools/TJC.Singleton", | ||
"enforcement": "active", | ||
"conditions": { | ||
"ref_name": { | ||
"exclude": [], | ||
"include": [ | ||
"~DEFAULT_BRANCH" | ||
] | ||
} | ||
}, | ||
"rules": [ | ||
{ | ||
"type": "deletion" | ||
}, | ||
{ | ||
"type": "non_fast_forward" | ||
}, | ||
{ | ||
"type": "pull_request", | ||
"parameters": { | ||
"required_approving_review_count": 1, | ||
"dismiss_stale_reviews_on_push": true, | ||
"require_code_owner_review": true, | ||
"require_last_push_approval": true, | ||
"required_review_thread_resolution": false | ||
} | ||
}, | ||
{ | ||
"type": "required_linear_history" | ||
}, | ||
{ | ||
"type": "required_status_checks", | ||
"parameters": { | ||
"strict_required_status_checks_policy": true, | ||
"required_status_checks": [ | ||
{ | ||
"context": "Continuous Testing (Testing.sln, 8.0.x)", | ||
"integration_id": 15368 | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"bypass_actors": [ | ||
{ | ||
"actor_id": 1, | ||
"actor_type": "OrganizationAdmin", | ||
"bypass_mode": "pull_request" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
name: Testing Matrix | ||
run-name: PR#${{ github.event.number }}${{ github.event.pull_request.draft && ' [DRAFT]' || '' }} - Continuous Testing (Matrix) - (${{ github.event.pull_request.head.ref }}-to-${{ github.event.pull_request.base.ref }}) | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- ready_for_review | ||
|
||
env: | ||
build_directory: Build | ||
test_project_suffix: Tests | ||
|
||
concurrency: | ||
group: Continuous-Testing-${{ github.event.pull_request.head.ref }}-to-${{ github.event.pull_request.base.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
buildAndRunTests: | ||
name: Continuous Testing | ||
permissions: write-all | ||
runs-on: windows-2022 | ||
if: ${{ !github.event.pull_request.draft }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
solution: [ Testing.sln ] | ||
dotnet-version: [ '8.0.x' ] | ||
|
||
steps: | ||
- name: Checkout [${{ github.event.pull_request.head.ref }}] | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
token: ${{ secrets.TJC_TOKEN || secrets.GITHUB_TOKEN }} | ||
submodules: recursive | ||
|
||
#################################################################################################### | ||
### Initialize ### | ||
#################################################################################################### | ||
# Check for Changes in the Non-Ignored Files; If there are none, then Skip Tests | ||
# Skip: README, LICENSE, .gitignore, GitHub Workflows & Actions, etc. | ||
- name: Check for Changes to Determine if Tests can be Skipped | ||
id: getChanges | ||
uses: tj-actions/changed-files@v45.0.0 | ||
with: | ||
files_ignore: | | ||
README.md | ||
LICENSE | ||
.github/** | ||
.gitignore | ||
- name: Check if Tests can be Skipped | ||
id: getCanSkip | ||
uses: actions/github-script@v7.0.1 | ||
with: | ||
result-encoding: string | ||
script: | | ||
var changes = '${{ fromJSON(steps.getChanges.outputs.any_modified) }}' | ||
var skip = changes == 'false' | ||
console.log('Skip:', skip) | ||
return skip | ||
#################################################################################################### | ||
### Prepare to Run Tests ### | ||
#################################################################################################### | ||
- name: Setup .NET [${{ matrix.dotnet-version }}] | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: ${{ matrix.dotnet-version }} | ||
|
||
- name: Setup NuGet | ||
uses: NuGet/setup-nuget@v2.0.0 | ||
|
||
- name: Restore NuGet | ||
run: nuget restore | ||
|
||
- name: Restore Dependencies | ||
if: ${{ !fromJSON(steps.getCanSkip.outputs.result) }} | ||
run: dotnet restore | ||
|
||
#################################################################################################### | ||
### Run Tests ### | ||
#################################################################################################### | ||
- name: Build | ||
if: ${{ !fromJSON(steps.getCanSkip.outputs.result) }} | ||
run: dotnet build --no-restore | ||
|
||
- name: Error - Build Failed for ${{ matrix.solution }} | ||
if: failure() | ||
uses: ./.github/actions/tools/annotation/error | ||
with: | ||
message: '[Error] Build Failed for ${{ matrix.solution }}' | ||
|
||
# Test 2 - Run All Unit Tests within Project | ||
# Note: This Action Requires Windows | ||
- name: Run Tests for [${{ matrix.solution }}] | ||
if: ${{ !fromJSON(steps.getCanSkip.outputs.result) }} | ||
run: dotnet test --no-build --verbosity normal | ||
|
||
- name: Error - Tests Failed for ${{ matrix.solution }} | ||
if: failure() | ||
uses: ./.github/actions/tools/annotation/error | ||
with: | ||
message: '[Error] Tests Failed for ${{ matrix.solution }}' | ||
|
||
#################################################################################################### | ||
### Notify Success ### | ||
#################################################################################################### | ||
- name: Success - Successfully Built & Ran Tests for ${{ matrix.solution }} | ||
if: success() && !fromJSON(steps.getCanSkip.outputs.result) | ||
uses: ./.github/actions/tools/annotation/notice | ||
with: | ||
message: '[Success] Built & Ran Tests for ${{ matrix.solution }}' | ||
|
||
- name: Success - Skipped Tests for ${{ matrix.solution }} | ||
if: success() && fromJSON(steps.getCanSkip.outputs.result) | ||
uses: ./.github/actions/tools/annotation/notice | ||
with: | ||
message: '[Success] Skipped Tests for ${{ matrix.solution }}' |
Oops, something went wrong.