Skip to content

Commit 836c7e6

Browse files
committed
feat: Avoid running tests if no code changed
1 parent 2feff80 commit 836c7e6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.github/workflows/Manual_Publish_Docker.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,22 @@ jobs:
129129
steps:
130130
- uses: actions/checkout@v4
131131

132+
- name: Generate code hash
133+
id: hash
134+
run: |
135+
# Create hash of all source and test files
136+
find src -type f \( -name "*.cs" -o -name "*.csproj" -o -name "*.json" -o -name "*.xml" \) -print0 | sort -z | xargs -0 sha256sum | sha256sum | cut -d' ' -f1 > code_hash.txt
137+
echo "code_hash=$(cat code_hash.txt)" >> $GITHUB_OUTPUT
138+
139+
- name: Check code hash cache
140+
id: cache-hash
141+
uses: actions/cache@v4
142+
with:
143+
path: code_hash.txt
144+
key: ${{ runner.os }}-code-${{ steps.hash.outputs.code_hash }}
145+
132146
- name: Set up Docker Buildx
147+
if: steps.cache-hash.outputs.cache-hit != 'true'
133148
uses: docker/setup-buildx-action@v2
134149

135150
- name: Run Tests

0 commit comments

Comments
 (0)