Skip to content

Commit

Permalink
chore(ci): use cache key action in perf workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
flrgh committed Jul 27, 2023
1 parent 918cf1a commit 7129e52
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,25 @@ jobs:
(startsWith(github.event.comment.body, '/perf') || startsWith(github.event.comment.body, '/flamegraph'))
)
outputs:
cache-key: ${{ steps.cache-key.outputs.cache-key }}

steps:
- name: Checkout Kong source code
uses: actions/checkout@v3

- name: Generate cache key
id: cache-key
uses: ./.github/actions/build-cache-key
with:
prefix: perf

- name: Lookup build cache
id: cache-deps
uses: actions/cache@v3
with:
path: |
${{ env.BUILD_ROOT }}
key: perf-${{ hashFiles('.requirements', 'kong-*.rockspec', '.bazelversion', '.bazelrc', 'build/**', 'BUILD.bazel', 'WORKSPACE', '.github/workflows/build_and_test.yml') }}
path: ${{ env.BUILD_ROOT }}
key: ${{ steps.cache-key.outputs.cache-key }}

- name: Install packages
if: steps.cache-deps.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -72,8 +80,6 @@ jobs:
run: |
make install-dev-rocks
# the above should be same as build_and_test.yml expect that perf.yml is used in cache_key

perf:
name: RPS, latency and flamegraphs
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -116,9 +122,8 @@ jobs:
if: env.GHA_CACHE == 'true'
uses: actions/cache@v3
with:
path: |
${{ env.BUILD_ROOT }}
key: perf-${{ hashFiles('.requirements', 'kong-*.rockspec', '.bazelversion', '.bazelrc', 'build/**', 'BUILD.bazel', 'WORKSPACE', '.github/workflows/build_and_test.yml') }}
path: ${{ env.BUILD_ROOT }}
key: ${{ needs.build-packages.outputs.cache-key }}

- name: Install performance test Dependencies
run: |
Expand Down

0 comments on commit 7129e52

Please sign in to comment.