Skip to content

Commit

Permalink
Changed key and restore-keys for benchmark cache
Browse files Browse the repository at this point in the history
  • Loading branch information
norberttech committed Oct 29, 2023
1 parent 6e9fc83 commit 91d6e8c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/benchmark-baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,19 @@ jobs:
- name: "Install locked dependencies"
run: "composer install --no-interaction --no-progress"

- name: Get Date
id: get-date
run: |
echo "date=$(date -u "+%Y%m%d%H%M%S")" >> $GITHUB_OUTPUT
shell: bash

- name: "Restore Benchmark cache"
uses: "actions/cache@v3"
with:
path: "var/phpbench"
key: "php-${{ matrix.php-version }}-${{ env.PHPBENCH_TAG }}-phpbench"
key: "php-${{ matrix.php-version }}-${{ env.PHPBENCH_TAG }}-phpbench-${{ steps.get-date.outputs.date }}"
restore-keys: |
php-${{ matrix.php-version }}-${{ env.PHPBENCH_TAG }}-phpbench
php-${{ matrix.php-version }}-${{ env.PHPBENCH_TAG }}-phpbench-
- name: "Benchmark"
run: |
Expand All @@ -97,10 +103,3 @@ jobs:
echo '```' >> $GITHUB_STEP_SUMMARY
composer test:benchmark -- --tag=${{ env.PHPBENCH_TAG }} --progress=none >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
- name: "Save Benchmark Baseline in cache"
id: cache-primes-save
uses: actions/cache/save@v3
with:
path: var/phpbench
key: "php-${{ matrix.php-version }}-${{ env.PHPBENCH_TAG }}-phpbench-${{ github.sha }}"
4 changes: 2 additions & 2 deletions .github/workflows/test-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ jobs:
uses: "actions/cache@v3"
with:
path: "var/phpbench"
key: "php-${{ matrix.php-version }}-1.x-phpbench"
key: "php-${{ matrix.php-version }}-1.x-phpbench-"
restore-keys: |
php-${{ matrix.php-version }}-1.x-phpbench
php-${{ matrix.php-version }}-1.x-phpbench-
- name: "Execute benchmarks"
id: init_comment
Expand Down

0 comments on commit 91d6e8c

Please sign in to comment.