Skip to content

Commit 22293e6

Browse files
authored
🧹 chore: GitHub Actions Cleanup (#74)
* GitHub Actions - Cleanup Testing Matrix * GitHub Actions - Cleanup Create Tag
1 parent 3387875 commit 22293e6

2 files changed

Lines changed: 26 additions & 16 deletions

File tree

.github/workflows/ct-matrix.yml

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,43 @@
11
# This workflow is used test the project, by doing the following
22
# 1. Ensure the project builds
3+
# 2. Run all tests
4+
# 3. Upload code coverage
35
---
46
name: Testing Matrix
57
run-name: >-
68
${{
79
format(
8-
'{0}{1}{2} - Continuous Testing (Matrix) - ({3}-to-{4})',
9-
github.event_name == 'pull_request' && 'PR#' || 'Push',
10-
github.event.pull_request.draft && ' [DRAFT]' || '',
11-
github.event_name == 'pull_request' && github.event.number || format(' [{0}]',github.ref_name),
12-
github.event.pull_request.head.ref,
13-
github.event.pull_request.base.ref
10+
'{0} - Continuous Testing (Matrix){1}',
11+
github.event_name == 'pull_request'
12+
&& format('PR#{0}{1}',github.event.number, github.event.pull_request.draft && ' [DRAFT]' || '')
13+
|| format('Push [{0}]', github.ref_name),
14+
github.event_name == 'pull_request'
15+
&& format(' - [{0}-to-{1}]', github.event.pull_request.head.ref, github.event.pull_request.base.ref)
16+
|| ''
1417
)
1518
}}
1619
1720
on:
21+
push:
22+
branches:
23+
- main
24+
- develop
1825
pull_request:
1926
branches:
2027
- main
28+
- develop
2129
types:
2230
- opened
2331
- reopened
2432
- synchronize
2533
- ready_for_review
34+
# Trigger if target branch was changed to a trunk
35+
pull_request_target:
36+
types:
37+
- edited
38+
branches:
39+
- main
40+
- develop
2641

2742
env:
2843
build_directory: Build
@@ -33,9 +48,9 @@ concurrency:
3348
cancel-in-progress: true
3449

3550
jobs:
36-
buildAndRunTests:
37-
name: Continuous Testing
38-
permissions:
51+
tests:
52+
name: Continuous Testing # Note: This name & matrix are used within the status checks - do not change
53+
permissions:
3954
contents: read # Read access to code and content in the repository
4055
pull-requests: read # Read access to pull request metadata for the event
4156
checks: write # Write access to report check results
@@ -48,7 +63,7 @@ jobs:
4863
dotnet-version: ["8.0.x"]
4964

5065
steps:
51-
- name: Checkout [${{ github.event.pull_request.head.ref }}]
66+
- name: ${{ format('Checkout [{0}]', github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name) }}
5267
uses: actions/checkout@v4
5368
with:
5469
ref: ${{ github.event.pull_request.head.ref }}
@@ -87,17 +102,14 @@ jobs:
87102
### Prepare to Run Tests ###
88103
####################################################################################################
89104
- name: Setup .NET [${{ matrix.dotnet-version }}]
90-
if: ${{ !fromJSON(steps.getCanSkip.outputs.result) }}
91105
uses: actions/setup-dotnet@v4
92106
with:
93107
dotnet-version: ${{ matrix.dotnet-version }}
94108

95109
- name: Setup NuGet
96-
if: ${{ !fromJSON(steps.getCanSkip.outputs.result) }}
97110
uses: NuGet/setup-nuget@v2.0.0
98111

99112
- name: Restore NuGet
100-
if: ${{ !fromJSON(steps.getCanSkip.outputs.result) }}
101113
run: nuget restore
102114

103115
- name: Restore Dependencies

.github/workflows/merge-creates-tag.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ jobs:
2424
pull-requests: read # Needed to read pull request labels and metadata
2525
if: github.event.pull_request.merged && (contains(join(github.event.pull_request.labels.*.name, ', '), 'major') || contains(join(github.event.pull_request.labels.*.name, ', '), 'minor') || contains(join(github.event.pull_request.labels.*.name, ', '), 'patch'))
2626
runs-on: windows-2022
27-
outputs:
28-
VersionNumber: ${{ steps.incrementVersion.outputs.result }}
2927
steps:
3028
- name: Checkout
3129
uses: actions/checkout@v4
@@ -72,7 +70,7 @@ jobs:
7270
git config --local user.name "github-actions[bot]"
7371
git commit -a -m "🤖 automated: Changelog ${{ steps.update-changelog.outputs.version }}" -m "Release Notes: ${{ steps.update-changelog.outputs.release-notes }}"
7472
git remote set-url origin https://<PAT>@github.com/${{ github.repository }}.git
75-
git push
73+
git push
7674
env:
7775
PAT: ${{ secrets.TJC_TOKEN }}
7876

0 commit comments

Comments
 (0)