Skip to content

Commit

Permalink
Remove split restore/save cache steps
Browse files Browse the repository at this point in the history
  • Loading branch information
dfsnow committed Aug 8, 2023
1 parent c60142d commit 938f629
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions .github/actions/prepare-ptaxsim/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,24 @@ runs:
echo "PTAXSIM_VERSION=${{ env.PTAXSIM_VERSION }}" >> $GITHUB_OUTPUT
shell: bash

- name: Restore database cache
uses: actions/cache/restore@v3.3.1
id: restore_db_cache
- name: Cache database
uses: actions/cache@v3.3.1
id: cache_db
with:
path: ptaxsim.db.bz2
key: ${{ format('{0}-{1}', env.PTAXSIM_VERSION, hashFiles('DESCRIPTION')) }}
enableCrossOsArchive: true

- name: Configure AWS credentials
if: steps.restore_db_cache.outputs.cache-hit != 'true'
if: steps.cache_db.outputs.cache-hit != 'true'
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ inputs.ASSUMED_ROLE }}
aws-region: us-east-1

- name: Fetch database file
id: fetch_db
if: steps.restore_db_cache.outputs.cache-hit != 'true'
if: steps.cache_db.outputs.cache-hit != 'true'
run: |
aws s3 cp ${{ inputs.PTAXSIM_DB_BASE_URL }}/ptaxsim-${{ env.PTAXSIM_VERSION }}.db.bz2 ${{ github.workspace }}/ptaxsim.db.bz2 --quiet
shell: bash
Expand All @@ -66,12 +66,3 @@ runs:
if: runner.os == 'Windows'
run: 7z x ptaxsim.db.bz2
shell: cmd

- name: Save database cache
uses: actions/cache/save@v3
id: save_db
if: steps.restore_db_cache.outputs.cache-hit != 'true'
with:
path: ptaxsim.db.bz2
key: ${{ format('{0}-{1}', env.PTAXSIM_VERSION, hashFiles('DESCRIPTION')) }}
enableCrossOsArchive: true

0 comments on commit 938f629

Please sign in to comment.