diff --git a/.editorconfig b/.editorconfig index 12e9562..beeadd0 100644 --- a/.editorconfig +++ b/.editorconfig @@ -195,4 +195,5 @@ dotnet_diagnostic.CA1853.severity = warning csharp_prefer_simple_using_statement = true:suggestion # Using directives must be placed inside of a namespace declaration +# IDE0065: Misplaced using directive csharp_using_directive_placement = inside_namespace diff --git a/.github/workflows/add-new-issue-to-project.yml b/.github/workflows/add-new-issue-to-project.yml new file mode 100644 index 0000000..39336ef --- /dev/null +++ b/.github/workflows/add-new-issue-to-project.yml @@ -0,0 +1,21 @@ +name: 🤖Add New Issue To Project + + +on: + issues: + types: opened + pull_request: + types: opened + branches: [main, preview] + + +jobs: + add_new_issue_to_project: + name: Add New Issue + uses: KinsonDigital/Infrastructure/.github/workflows/add-issue-to-project.yml@v10.2.0 + with: + org-name: "${{ vars.ORGANIZATION_NAME }}" + org-project-name: "${{ vars.ORG_PROJECT_NAME }}" + project-name: "${{ vars.PROJECT_NAME }}" + secrets: + cicd-pat: ${{ secrets.CICD_TOKEN }} diff --git a/.github/workflows/build-status-check.yml b/.github/workflows/build-status-check.yml new file mode 100644 index 0000000..9e306ea --- /dev/null +++ b/.github/workflows/build-status-check.yml @@ -0,0 +1,17 @@ +name: ✅Build Status Check +run-name: ✅Build Status Check (${{ github.base_ref }} branch) + + +on: + pull_request: + branches: [main, preview] + + +jobs: + build_status_check: + name: ${{ vars.PROJECT_NAME }} Build Status Check + uses: KinsonDigital/Infrastructure/.github/workflows/build-csharp-project.yml@v10.2.0 + with: + project-name: "${{ vars.PROJECT_NAME }}" + build-config: Debug + net-sdk-version: "${{ vars.NET_SDK_VERSION }}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..82039a6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,61 @@ +name: 🚀Release +run-name: ${{ vars.PROJECT_NAME }} ${{ inputs.release-type }} Release ${{ inputs.dry-run == true && '(Dry Run)' || '' }} + + +defaults: + run: + shell: pwsh + + +on: + workflow_dispatch: + inputs: + release-type: + description: The type of release. Choose 'Preview' or 'Production'. + required: true + type: choice + options: [Preview, Production] + dry-run: + description: Dry Run - Check to run the workflow without creating a release. + required: false + default: false + type: boolean + + +jobs: + determine_release_notes_path: + name: Determine Release Notes Dir Path + runs-on: ubuntu-latest + outputs: + release-notes-dir-path: ${{ steps.get-dir-path.outputs.release-notes-dir-path }} + steps: + - name: Get Dir Path + id: get-dir-path + run: | + $dirPath = "${{ inputs.release-type }}" -eq "Production" ? "${{ vars.PROD_RELATIVE_RELEASE_NOTES_DIR_PATH }}" : "${{ vars.PREV_RELATIVE_RELEASE_NOTES_DIR_PATH }}"; + "release-notes-dir-path=$dirPath" >> $env:GITHUB_OUTPUT; + + + run_release: + name: Performing ${{ inputs.release-type }} Release of ${{ vars.PROJECT_NAME }} (${{ inputs.release-type == 'Production' && 'Release' || 'Debug' }}) + needs: determine_release_notes_path + uses: KinsonDigital/Infrastructure/.github/workflows/dotnet-lib-release.yml@v10.2.0 + with: + project-name: "${{ vars.PROJECT_NAME}}" + release-type: "${{ inputs.release-type }}" + run-branch: "${{ github.ref_name }}" + net-sdk-version: "${{ vars.NET_SDK_VERSION }}" + relative-release-notes-dir-path: "${{ needs.determine_release_notes_path.outputs.release-notes-dir-path }}" + release-notes-file-name-prefix: "${{ vars.RELEASE_NOTES_FILE_NAME_PREFIX }}" + build-config: ${{ inputs.release-type == 'Production' && 'Release' || 'Debug' }} + pr-include-notes-label: "${{ vars.PR_INCLUDE_NOTES_LABEL }}" + send-release-tweet: ${{ vars.TWITTER_BROADCAST_ENABLED == 'true' }} + dry-run: ${{ inputs.dry-run }} + transpile-readme: true + secrets: + cicd-pat: "${{ secrets.CICD_TOKEN }}" + nuget-org-api-key: "${{ secrets.NUGET_ORG_API_KEY }}" + twitter-consumer-api-key: "${{ secrets.TWITTER_CONSUMER_API_KEY }}" + twitter-consumer-api-secret: "${{ secrets.TWITTER_CONSUMER_API_SECRET }}" + twitter-access-token: "${{ secrets.TWITTER_ACCESS_TOKEN }}" + twitter-access-token-secret: "${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}" diff --git a/.github/workflows/sync-bot.yml b/.github/workflows/sync-bot.yml new file mode 100644 index 0000000..e95e0b9 --- /dev/null +++ b/.github/workflows/sync-bot.yml @@ -0,0 +1,54 @@ +name: 🤖Sync Bot + + +defaults: + run: + shell: pwsh + + +on: + issues: + types: [labeled, unlabeled, assigned, unassigned, milestoned, demilestoned] + + +jobs: + sync_bot: + name: Sync Bot Status Check + if: ${{ !github.event.issue.pull_request }} + runs-on: ubuntu-latest + steps: + - name: Set Up Deno + if: startsWith(github.ref_name, 'feature/') + uses: denoland/setup-deno@v1 + with: + deno-version: v1.x + + - name: Run Sync Bot (Issue Change) + if: startsWith(github.ref_name, 'feature/') + run: | + $scriptUrl = "${{ vars.SCRIPT_BASE_URL }}/${{ vars.CICD_SCRIPTS_VERSION }}/${{ vars.SCRIPT_RELATIVE_DIR_PATH}}/sync-bot-status-check.ts"; + + $issueNumber = "${{ github.event.issue.number }}"; + + Write-Host "::notice::Project Name: ${{ vars.PROJECT_NAME }}"; + Write-Host "::notice::Issue: $issueNumber"; + + if ($manuallyExecuted -and $issueNumber -eq "0") { + Write-Host "::notice::The issue or PR number must be a value greater than 0."; + exit 1; + } + + <# Deno Args: + 1. Organization name + 2. Project name + 3. Issue number + 4. Event Type - set to issue event type + 5. PAT + #> + deno run ` + --allow-net ` + "$scriptUrl" ` + "${{ vars.PROJECT_NAME }}" ` + "$issueNumber" ` + "issue" ` + "${{ secrets.CICD_TOKEN }}"; diff --git a/.github/workflows/sync-issue-to-pr.yml b/.github/workflows/sync-issue-to-pr.yml new file mode 100644 index 0000000..dc2ace5 --- /dev/null +++ b/.github/workflows/sync-issue-to-pr.yml @@ -0,0 +1,55 @@ +name: 🔄️Sync Issue To PR + + +defaults: + run: + shell: pwsh + + +on: + pull_request: + types: opened + issue_comment: # This event is triggered when creating issue and pr comments + types: created + + +jobs: + sync_issue_to_pr: + name: Start Sync Process + if: | + (github.event_name == 'issue_comment' && contains(github.event.comment.body, '[run-sync]')) || + github.event_name == 'pull_request' && startsWith(github.head_ref, 'feature/') + runs-on: ubuntu-latest + steps: + - name: Set Up Deno + uses: denoland/setup-deno@v1 + with: + deno-version: v1.x + + - name: Sync + run: | + $eventName = "${{ github.event_name }}"; + $scriptUrl = "${{ vars.SCRIPT_BASE_URL }}/${{ vars.CICD_SCRIPTS_VERSION }}/${{ vars.SCRIPT_RELATIVE_DIR_PATH }}/sync-issue-to-pr.ts"; + $issueOrPrNumber = $eventName -eq "pull_request" ? "${{ github.event.number }}" : "${{ github.event.issue.number }}"; + + Write-Host "::notice::Event Type: $eventName"; + Write-Host "::notice::Organization Name: ${{ vars.ORGANIZATION_NAME }}"; + Write-Host "::notice::Project Name: ${{ vars.PROJECT_NAME }}"; + Write-Host "::notice::Requested By: ${{ github.event.sender.login }}"; + Write-Host "::notice::PR Number: $issueOrPrNumber"; + + <# Deno Args: + 1. Organization name + 2. Project name + 3. Triggered by user + 4. Issue or pull request number + 5. PAT + #> + deno run ` + --allow-net ` + "$scriptUrl" ` + "${{ vars.ORGANIZATION_NAME }}" ` + "${{ vars.PROJECT_NAME }}" ` + "${{ github.event.sender.login }}" ` + "$issueOrPrNumber" ` + "${{ secrets.CICD_TOKEN }}"; diff --git a/.github/workflows/sync-status-check.yml b/.github/workflows/sync-status-check.yml new file mode 100644 index 0000000..e1e85c7 --- /dev/null +++ b/.github/workflows/sync-status-check.yml @@ -0,0 +1,53 @@ +name: ✅Sync Status Check + + +defaults: + run: + shell: pwsh + + +on: + pull_request: + branches: [main, preview] + + +jobs: + sync_status_check: + name: Sync Status Check + if: startsWith(github.head_ref, 'feature/') + runs-on: ubuntu-latest + steps: + - name: Set Up Deno + uses: denoland/setup-deno@v1 + with: + deno-version: v1.x + + - name: Run Sync Status Check + run: | + $scriptUrl = "${{ vars.SCRIPT_BASE_URL }}/${{ vars.CICD_SCRIPTS_VERSION }}/${{ vars.SCRIPT_RELATIVE_DIR_PATH}}/sync-bot-status-check.ts"; + $prNumber = "${{ github.event.number }}"; + + Write-Host "::notice::Project Name: ${{ vars.PROJECT_NAME }}"; + Write-Host "::notice::PR Number: $prNumber"; + Write-Host "::notice::Event Type: pr"; + + if ($manuallyExecuted -and $prNumber -eq "0") { + Write-Host "::notice::The issue or PR number must be a value greater than 0."; + exit 1; + } + + <# Deno Args: + 1. Organization name + 2. Project name + 3. Pull request number + 4. Event Type - set to pull request event type + 5. PAT + #> + deno run ` + --allow-net ` + "$scriptUrl" ` + "${{ vars.ORGANIZATION_NAME }}" ` + "${{ vars.PROJECT_NAME }}" ` + "$prNumber" ` + "pr" ` + "${{ secrets.CICD_TOKEN }}"; diff --git a/.github/workflows/triage-issue.yml b/.github/workflows/triage-issue.yml new file mode 100644 index 0000000..4bfc6eb --- /dev/null +++ b/.github/workflows/triage-issue.yml @@ -0,0 +1,21 @@ +name: 🤖Triage Issue + + +on: + issues: + types: [opened] + + +jobs: + label_issues: + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: Label issues + uses: andymckay/labeler@1.0.4 + with: + add-labels: "⚕️NEEDS TRIAGE" + ignore-if-assigned: true + ignore-if-labeled: true + repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/unit-test-status-check.yml b/.github/workflows/unit-test-status-check.yml new file mode 100644 index 0000000..fa0035c --- /dev/null +++ b/.github/workflows/unit-test-status-check.yml @@ -0,0 +1,18 @@ +name: ✅Unit Testing Status Check +run-name: ✅Unit Testing Status Check (${{ github.base_ref }} branch) + + +on: + workflow_dispatch: + pull_request: + branches: [main, preview] + + +jobs: + run_tests: + name: ${{ vars.PROJECT_NAME }} Test Status Check + uses: KinsonDigital/Infrastructure/.github/workflows/run-csharp-tests.yml@v10.2.0 + with: + project-name: "${{ vars.PROJECT_NAME }}Tests" + build-config: Debug + net-sdk-version: "${{ vars.NET_SDK_VERSION }}" diff --git a/.vscode/settings.json b/.vscode/settings.json index 6d356ea..7ab427f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,5 +5,22 @@ "pwsh", "runsettings" ], - "dotnet.defaultSolution": "Plazma.sln" + "dotnet.defaultSolution": "Plazma.sln", + "[csharp]": { + "editor.insertSpaces": false, + "editor.indentSize": 4, + }, + "[jsonc]": { + "editor.insertSpaces": false, + "editor.tabSize": 4, + }, + "[yaml]": { + "editor.insertSpaces": true, + "editor.tabSize": 2, + }, + "editor.detectIndentation": false, + "[github-actions-workflow]": { + "editor.tabSize": 2, + "editor.insertSpaces": true + } } diff --git a/Plazma.sln b/Plazma.sln index 3d984e4..3d24ac9 100644 --- a/Plazma.sln +++ b/Plazma.sln @@ -17,9 +17,20 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution codecov.yml = codecov.yml LICENSE.md = LICENSE.md README.md = README.md + renovate.json = renovate.json EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Workflows", "Workflows", "{8518113E-D0C3-4E63-8F2E-542EB6D1CCE9}" + ProjectSection(SolutionItems) = preProject + .github\workflows\add-new-issue-to-project.yml = .github\workflows\add-new-issue-to-project.yml + .github\workflows\build-status-check.yml = .github\workflows\build-status-check.yml + .github\workflows\release.yml = .github\workflows\release.yml + .github\workflows\sync-bot.yml = .github\workflows\sync-bot.yml + .github\workflows\sync-issue-to-pr.yml = .github\workflows\sync-issue-to-pr.yml + .github\workflows\sync-status-check.yml = .github\workflows\sync-status-check.yml + .github\workflows\triage-issue.yml = .github\workflows\triage-issue.yml + .github\workflows\unit-test-status-check.yml = .github\workflows\unit-test-status-check.yml + EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PlazmaTests", "Testing\PlazmaTests\PlazmaTests.csproj", "{AF6A9738-F676-408A-B1B9-E7F43631BC08}" EndProject diff --git a/Plazma.sln.DotSettings b/Plazma.sln.DotSettings index 966c316..1b06239 100644 --- a/Plazma.sln.DotSettings +++ b/Plazma.sln.DotSettings @@ -75,6 +75,8 @@ public void Ctor_WithNull$PARAM_1$Param_ThrowsException() /// <returns>The instance to test.</returns> private $OBJECT_TYPE$ CreateSystemUnderTest() => new ($END$); + True + True True True True diff --git a/Plazma/ParticleColor.cs b/Plazma/ParticleColor.cs index e9a8a35..1cd358c 100644 --- a/Plazma/ParticleColor.cs +++ b/Plazma/ParticleColor.cs @@ -462,7 +462,7 @@ public ParticleColor(byte a, byte r, byte g, byte b) public static ParticleColor MediumSpringGreen => new ParticleColor(255, 0, 250, 154); /// - /// Gets get the color MdeiumTurquoise. + /// Gets get the color MediumTurquoise. /// public static ParticleColor MediumTurquoise => new ParticleColor(255, 72, 209, 204); @@ -717,7 +717,7 @@ public ParticleColor(byte a, byte r, byte g, byte b) public static ParticleColor Yellow => new ParticleColor(255, 255, 255, 0); /// - /// Gets get the color YelloGreen. + /// Gets get the color YellowGreen. /// public static ParticleColor YellowGreen => new ParticleColor(255, 154, 205, 50);