Skip to content

Commit

Permalink
Cherry-pick: Updates to workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cgokmen committed Jan 28, 2024
1 parent da5706d commit 8369c59
Showing 1 changed file with 48 additions and 6 deletions.
54 changes: 48 additions & 6 deletions .github/workflows/pull-sheets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,76 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout code
- name: Clone BDDL repo
uses: actions/checkout@v3
with:
path: bddl
ref: develop

- name: Clone ig pipeline repo
uses: actions/checkout@v3
with:
repository: StanfordVL/ig_pipeline
path: ig_pipeline
token: ${{ secrets.REPO_TOKEN }}

- name: Setup python
uses: actions/setup-python@v2
with:
python-version: "3.8"
architecture: x64

- name: Authenticate on Google Cloud
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'

# See if we need to re-pull any ig_pipeline data from DVC.
- name: Check cache for ig_pipeline data
id: cache-pipeline
uses: actions/cache@v3
with:
key: ig_pipeline-${{ hashFiles('ig_pipeline/dvc.lock') }}
path: |
ig_pipeline/artifacts/pipeline/combined_room_object_list.json
ig_pipeline/artifacts/pipeline/combined_room_object_list_future.json
ig_pipeline/artifacts/pipeline/object_inventory.json
ig_pipeline/artifacts/pipeline/object_inventory_future.json
- if: ${{ steps.cache-pipeline.outputs.cache-hit != 'true' }}
name: Install dvc
run: pip install dvc[gs]

- if: ${{ steps.cache-pipeline.outputs.cache-hit != 'true' }}
name: Pull dvc data
working-directory: ig_pipeline
run: dvc pull combined_room_object_list combined_room_object_list_future object_inventory object_inventory_future

- if: ${{ steps.cache-pipeline.outputs.cache-hit != 'true' }}
name: Unprotect data
working-directory: ig_pipeline
run: dvc unprotect artifacts/pipeline/combined_room_object_list.json artifacts/pipeline/combined_room_object_list_future.json artifacts/pipeline/object_inventory.json artifacts/pipeline/object_inventory_future.json

- name: Copy over ig_pipeline files
run: cp ig_pipeline/artifacts/pipeline/{combined_room_object_list,combined_room_object_list_future,object_inventory,object_inventory_future}.json bddl/bddl/generated_data

- name: Install BDDL
working-directory: bddl
run: pip install -e .

- name: Install dev requirements
working-directory: bddl
run: pip install -r requirements-dev.txt

- name: Authenticate on Google Cloud
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'

- name: Refresh sheets data
working-directory: bddl
run: python -m bddl.data_generation.pull_sheets

- name: Refresh derivative data
working-directory: bddl
run: python -m bddl.data_generation.generate_datafiles

- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Sync Google Sheets data"
repository: bddl

0 comments on commit 8369c59

Please sign in to comment.