Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
Skip more steps on cache-hit
Browse files Browse the repository at this point in the history
  • Loading branch information
Porges committed Jul 3, 2022
1 parent 14e0ee5 commit 12f129b
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,16 @@ jobs:
runs-on: "${{ matrix.os }}"
steps:
- uses: actions/checkout@v2
- name: Rust artifact cache
id: cache-agent-artifacts
uses: actions/cache@v3
with:
# if nothing has changed inside src/agent, we can reuse the artifacts directory
path: artifacts
key: agent-artifacts-${{ runner.os }}-${{ hashFiles('src/agent/**/*') }}-${{ env.ACTIONS_CACHE_KEY_DATE }}
# note: also including the ACTIONS_CACHE_KEY_DATE to rebuild if the Prereq Cache is invalidated
- name: Rust Prereq Cache
if: steps.cache-agent-artifacts.outputs.cache-hit != 'true'
uses: actions/cache@v2
id: cache-rust-prereqs
with:
Expand All @@ -30,10 +39,11 @@ jobs:
~/.cargo/bin
key: rust-${{ runner.os }}-${{ env.ACTIONS_CACHE_KEY_DATE }}
- name: Install Rust Prereqs
if: steps.cache-rust-prereqs.outputs.cache-hit != 'true'
if: steps.cache-rust-prereqs.outputs.cache-hit != 'true' && steps.cache-agent-artifacts.outputs.cache-hit != 'true'
shell: bash
run: src/ci/rust-prereqs.sh
- name: Rust Compile Cache
if: steps.cache-agent-artifacts.outputs.cache-hit != 'true'
uses: actions/cache@v2
with:
path: |
Expand All @@ -47,15 +57,7 @@ jobs:
run: |
sudo apt-get -y update
sudo apt-get -y install libssl1.0-dev libunwind-dev
if: "${{ runner.os == 'Linux' }}"
- name: Rust artifact cache
id: cache-agent-artifacts
uses: actions/cache@v3
with:
# if nothing has changed inside src/agent, we can reuse the artifacts directory
path: artifacts
key: agent-artifacts-${{ runner.os }}-${{ hashFiles('src/agent/**/*') }}-${{ env.ACTIONS_CACHE_KEY_DATE }}
# note: also including the ACTIONS_CACHE_KEY_DATE to rebuild if the Prereq Cache is invalidated
if: runner.os == 'Linux' && steps.cache-agent-artifacts.outputs.cache-hit != 'true'
- run: src/ci/agent.sh
if: steps.cache-agent-artifacts.outputs.cache-hit != 'true'
shell: bash
Expand Down

0 comments on commit 12f129b

Please sign in to comment.