File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -40,14 +40,24 @@ runs:
4040 mkdir gitstream
4141 cd gitstream
4242 mkdir repo
43+
44+ - name : Cache gitstream results
45+ id : cache-gitstream-results
46+ uses : actions/cache@v3
47+ with :
48+ path : gitstream/cache.json
49+ key : ${{ fromJSON(fromJSON(github.event.inputs.client_payload)).headSha }}-gitsream-cache
50+
4351 - name : Checkout head branch
4452 uses : actions/checkout@v3
53+ if : ${{ steps.cache-gitstream-results.outputs.cache-hit != 'true' }}
4554 with :
4655 repository : ${{ inputs.full_repository }}
4756 ref : ${{ github.event.inputs.head_ref }}
4857 path : ' gitstream/repo/'
4958 token : ${{ fromJSON(fromJSON(github.event.inputs.client_payload)).githubToken || github.token }}
50- - run : |
59+ - if : ${{ steps.cache-gitstream-results.outputs.cache-hit != 'true' }}
60+ run : |
5161 all=2147483647
5262 cd gitstream
5363 cd repo
7787 docker pull gitstream/rules-engine:latest
7888 echo "docker-pull-duration=$SECONDS" >> $GITHUB_OUTPUT
7989 SECONDS=0
80- docker run -v $(pwd)/gitstream:/code -e HEAD_REF=${{ github.event.inputs.head_ref }} -e BASE_REF=${{ github.event.inputs.base_ref }} -e CLIENT_PAYLOAD=${{ github.event.inputs.client_payload }} -e RULES_RESOLVER_URL=${{ github.event.inputs.resolver_url }} -e RULES_RESOLVER_TOKEN=${{ github.event.inputs.resolver_token }} -e DEBUG_MODE=${{ github.event.inputs.debug_mode }} gitstream/rules-engine
90+ docker run -v $(pwd)/gitstream:/code -e USE_CACHE=${{ steps.cache-gitstream-results.outputs.cache-hit }} -e HEAD_REF=${{ github.event.inputs.head_ref }} -e BASE_REF=${{ github.event.inputs.base_ref }} -e CLIENT_PAYLOAD=${{ github.event.inputs.client_payload }} -e RULES_RESOLVER_URL=${{ github.event.inputs.resolver_url }} -e RULES_RESOLVER_TOKEN=${{ github.event.inputs.resolver_token }} -e DEBUG_MODE=${{ github.event.inputs.debug_mode }} gitstream/rules-engine
8191 echo "docker-run-duration=$SECONDS" >> $GITHUB_OUTPUT
8292 echo "action-run-duration=$(($EPOCHSECONDS - ${{ steps.start.outputs.timestamp }}))" >> $GITHUB_OUTPUT
83- shell : bash
93+ shell : bash
You can’t perform that action at this time.
0 commit comments