Skip to content

Commit

Permalink
Move PTAXSIM db file to runner temp dir
Browse files Browse the repository at this point in the history
  • Loading branch information
dfsnow committed May 3, 2024
1 parent 9971e4e commit 61e2c23
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
11 changes: 6 additions & 5 deletions .github/actions/prepare-ptaxsim/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ runs:
id: version_db
run: |
DESCRIPTION_PATH=$(echo "${{ github.workspace }}/DESCRIPTION" | sed 's/\\/\//g')
echo "PTAXSIM_DB_PATH=${{ env.RUNNER_TEMP }}" >> $GITHUB_ENV
echo "PTAXSIM_VERSION=$(sed -n 's/.*Wants_DB_Version: \([0-9]*\.[0-9]*\.[0-9]\).*/\1/p' $DESCRIPTION_PATH)" >> $GITHUB_ENV
echo "PTAXSIM_VERSION=${{ env.PTAXSIM_VERSION }}" >> $GITHUB_OUTPUT
shell: bash
Expand All @@ -30,7 +31,7 @@ runs:
uses: actions/[email protected]
id: cache_db
with:
path: ptaxsim.db.bz2
path: ${{ env.RUNNER_TEMP }}/ptaxsim.db.bz2
key: ${{ format('{0}-{1}', env.PTAXSIM_VERSION, hashFiles('DESCRIPTION')) }}
enableCrossOsArchive: true

Expand All @@ -45,25 +46,25 @@ runs:
id: fetch_db
if: steps.cache_db.outputs.cache-hit != 'true'
run: |
aws s3 cp ${{ inputs.PTAXSIM_DB_BASE_URI }}/ptaxsim-${{ env.PTAXSIM_VERSION }}.db.bz2 ptaxsim.db.bz2 --quiet
aws s3 cp ${{ inputs.PTAXSIM_DB_BASE_URI }}/ptaxsim-${{ env.PTAXSIM_VERSION }}.db.bz2 ${{ env.RUNNER_TEMP }}/ptaxsim.db.bz2 --quiet
shell: bash

- name: Unpack database (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get install -y pbzip2
pbzip2 -dk ${{ github.workspace }}/ptaxsim.db.bz2
pbzip2 -dk ${{ env.RUNNER_TEMP }}/ptaxsim.db.bz2
shell: bash

- name: Unpack database (macOS)
if: runner.os == 'macOS'
run: |
brew install pbzip2
pbzip2 -dk ${{ github.workspace }}/ptaxsim.db.bz2
pbzip2 -dk ${{ env.RUNNER_TEMP }}/ptaxsim.db.bz2
shell: bash

- name: Unpack database (Windows)
if: runner.os == 'Windows'
run: |
7z x ${{ github.workspace }}\ptaxsim.db.bz2
7z x ${{ env.RUNNER_TEMP }}\ptaxsim.db.bz2
shell: cmd
2 changes: 0 additions & 2 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ name: pkgdown
jobs:
build-pkgdown-site:
runs-on: ubuntu-latest
env:
PTAXSIM_DB_PATH: ${{ github.workspace }}/ptaxsim.db

# Required for OIDC access to S3
permissions:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ name: test-coverage
jobs:
test-coverage:
runs-on: ubuntu-latest
env:
PTAXSIM_DB_PATH: ${{ github.workspace }}/ptaxsim.db

# Required for OIDC access to S3
permissions:
Expand Down

0 comments on commit 61e2c23

Please sign in to comment.