Skip to content

Commit

Permalink
feat: Avoid running tests if no code changed
Browse files Browse the repository at this point in the history
  • Loading branch information
carlreid committed Feb 17, 2025
1 parent 2feff80 commit 836c7e6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/Manual_Publish_Docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,22 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Generate code hash
id: hash
run: |
# Create hash of all source and test files
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
echo "code_hash=$(cat code_hash.txt)" >> $GITHUB_OUTPUT
- name: Check code hash cache
id: cache-hash
uses: actions/cache@v4
with:
path: code_hash.txt
key: ${{ runner.os }}-code-${{ steps.hash.outputs.code_hash }}

- name: Set up Docker Buildx
if: steps.cache-hash.outputs.cache-hit != 'true'
uses: docker/setup-buildx-action@v2

- name: Run Tests
Expand Down

0 comments on commit 836c7e6

Please sign in to comment.