Skip to content

Commit

Permalink
Use HEAD SHA to track caches (masesgroup#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
masesdevelopers authored May 15, 2024
1 parent 248e25d commit d15b6f2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,16 @@ jobs:
- name: Build JAR files
run: dotnet bin/net8.0/MASES.JCOReflectorCLI.dll -JobType CreateJars -JDKFolder $JAVA_HOME_11_X64 -JobFile .github/workflows/createjars_net8.0_linux.job

- name: Extract commit SHA
run: |
echo "GITHUB_COMMIT_MESSAGE=$(echo $GITHUB_SHA | cut -c 1-7)" >> $GITHUB_ENV
- name: Save JCOReflector bin in cache
uses: actions/cache/save@v4
with:
enableCrossOsArchive: true
path: ./bin/
key: JCOReflector_linux_bin_${{ github.run_id }}_${{ github.run_attempt }}
key: JCOReflector_linux_bin_${{ env.GITHUB_SHA }}


execute_java_tests:
Expand Down Expand Up @@ -121,7 +125,7 @@ jobs:
fail-on-cache-miss: true
enableCrossOsArchive: true
path: ./bin/
key: JCOReflector_linux_bin_${{ github.run_id }}_${{ github.run_attempt }}
key: JCOReflector_linux_bin_${{ env.GITHUB_SHA }}

- name: Set up JDK distribution
uses: actions/setup-java@v4
Expand Down Expand Up @@ -207,7 +211,7 @@ jobs:
fail-on-cache-miss: true
enableCrossOsArchive: true
path: ./bin/
key: JCOReflector_linux_bin_${{ github.run_id }}_${{ github.run_attempt }}
key: JCOReflector_linux_bin_${{ env.GITHUB_SHA }}

- name: Set up JDK distribution
uses: actions/setup-java@v4
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,14 @@ jobs:
with:
enableCrossOsArchive: true
path: ./src/jvm/
key: JCOReflector_source_${{ github.run_id }}_${{ github.run_attempt }}
key: JCOReflector_source_${{ env.GITHUB_SHA }}

- name: Save JCOReflector bin in cache
uses: actions/cache/save@v4
with:
enableCrossOsArchive: true
path: ./bin/
key: JCOReflector_windows_bin_${{ github.run_id }}_${{ github.run_attempt }}
key: JCOReflector_windows_bin_${{ env.GITHUB_SHA }}

execute_java_tests:
needs: build_windows
Expand Down Expand Up @@ -173,7 +173,7 @@ jobs:
fail-on-cache-miss: true
enableCrossOsArchive: true
path: ./bin/
key: JCOReflector_windows_bin_${{ github.run_id }}_${{ github.run_attempt }}
key: JCOReflector_windows_bin_${{ env.GITHUB_SHA }}

- name: Set up JDK distribution
uses: actions/setup-java@v4
Expand Down Expand Up @@ -272,7 +272,7 @@ jobs:
fail-on-cache-miss: true
enableCrossOsArchive: true
path: ./bin/
key: JCOReflector_windows_bin_${{ github.run_id }}_${{ github.run_attempt }}
key: JCOReflector_windows_bin_${{ env.GITHUB_SHA }}

- name: Set up JDK distribution
uses: actions/setup-java@v4
Expand Down Expand Up @@ -379,15 +379,15 @@ jobs:
fail-on-cache-miss: true
enableCrossOsArchive: true
path: ./bin/
key: JCOReflector_windows_bin_${{ github.run_id }}_${{ github.run_attempt }}
key: JCOReflector_windows_bin_${{ env.GITHUB_SHA }}

- name: Restore JCOReflector source from cache
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
enableCrossOsArchive: true
path: ./src/jvm/
key: JCOReflector_source_${{ github.run_id }}_${{ github.run_attempt }}
key: JCOReflector_source_${{ env.GITHUB_SHA }}

- name: Compress release files
run: |
Expand All @@ -399,7 +399,7 @@ jobs:
run: |
echo "GITHUB_COMMIT_MESSAGE=$(echo $GITHUB_SHA | cut -c 1-7)" >> $GITHUB_ENV
shell: bash

- name: Commit statistics changes
if: ${{ github.repository_owner == 'masesgroup'}} #do not push any changes outside main repo
uses: EndBug/add-and-commit@v9
Expand Down

0 comments on commit d15b6f2

Please sign in to comment.