From 68f43701335b1ba513e21d75f31033f2175ea187 Mon Sep 17 00:00:00 2001 From: Matthew Tancik Date: Tue, 23 Aug 2022 17:30:03 +0100 Subject: [PATCH] Cache envs for faster github actions (#291) * Cache pip for faster actions * Add caching to viewer * Fix Path * typo * try path again * Fancier caching --- .github/workflows/core_code_checks.yml | 10 ++++++---- .github/workflows/viewer_build_deploy.yml | 5 +++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/core_code_checks.yml b/.github/workflows/core_code_checks.yml index e2b39e40bc..21d3959ea7 100644 --- a/.github/workflows/core_code_checks.yml +++ b/.github/workflows/core_code_checks.yml @@ -16,14 +16,16 @@ jobs: steps: - uses: actions/checkout@v3 - name: Set up Python 3.8.12 - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: '3.8.12' + - uses: actions/cache@v2 + with: + path: ${{ env.pythonLocation }} + key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('dev-requirements.txt') }} - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install -r environment/requirements.txt - pip install -e . + pip install --upgrade --upgrade-strategy eager -r environment/requirements.txt -e . - name: Run license checks run: | ./scripts/licensing/license_headers.sh --check diff --git a/.github/workflows/viewer_build_deploy.yml b/.github/workflows/viewer_build_deploy.yml index ea89637cf8..ffa21cfd31 100644 --- a/.github/workflows/viewer_build_deploy.yml +++ b/.github/workflows/viewer_build_deploy.yml @@ -21,7 +21,8 @@ jobs: uses: actions/setup-node@v3 with: node-version: 17.8.0 - # cache: 'yarn' + cache: 'yarn' + cache-dependency-path: ./nerfactory/viewer/app/yarn.lock - name: Install packages run: yarn install @@ -71,4 +72,4 @@ jobs: - run: ssh github_action_remote_machine 'rm -rf /home/eweb0124/viewer/branch/${{ env.BRANCH_NAME }}' - run: scp -r ./nerfactory/viewer/app/build github_action_remote_machine:/home/eweb0124/ # TODO(ethan): move the current version to an older folder - - run: ssh github_action_remote_machine 'mv /home/eweb0124/build /home/eweb0124/viewer/branch/${{ env.BRANCH_NAME }}' \ No newline at end of file + - run: ssh github_action_remote_machine 'mv /home/eweb0124/build /home/eweb0124/viewer/branch/${{ env.BRANCH_NAME }}'