From 9122b35c753fb89e1f3a3133f8f63c8e8304fbc9 Mon Sep 17 00:00:00 2001 From: Tim Nunamaker Date: Tue, 27 Feb 2024 15:23:59 -0600 Subject: [PATCH] Poetry caching --- .github/workflows/ci.yml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 301f9f5..200ae7b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,14 +16,6 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/cache@v4 - with: - path: | - selfie-ui/.next/cache - key: ${{ runner.os }}-nextjs-${{ hashFiles('selfie-ui/**/yarn.lock') }}-${{ hashFiles('selfie-ui/**/*.js', 'selfie-ui/**/*.jsx', 'selfie-ui/**/*.ts', 'selfie-ui/**/*.tsx') }} - restore-keys: | - ${{ runner.os }}-nextjs-${{ hashFiles('selfie-ui/**/yarn.lock') }}- - - name: Use Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: @@ -34,6 +26,16 @@ jobs: curl -sSL https://install.python-poetry.org | python3 - echo "$HOME/.local/bin" >> $GITHUB_PATH + - name: Cache Poetry virtualenvs and artifacts + uses: actions/cache@v4 + with: + path: | + ~/.cache/pypoetry/virtualenvs + ~/.cache/pypoetry/artifacts + key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}-${{ matrix.python-version }} + restore-keys: | + ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}- + - name: Install dependencies with Poetry run: poetry install @@ -44,5 +46,14 @@ jobs: cache: 'yarn' cache-dependency-path: selfie-ui/yarn.lock + - name: Cache Next.js build artifacts + uses: actions/cache@v4 + with: + path: | + selfie-ui/.next/cache + key: ${{ runner.os }}-nextjs-${{ hashFiles('selfie-ui/**/yarn.lock') }}-${{ hashFiles('selfie-ui/**/*.js', 'selfie-ui/**/*.jsx', 'selfie-ui/**/*.ts', 'selfie-ui/**/*.tsx') }} + restore-keys: | + ${{ runner.os }}-nextjs-${{ hashFiles('selfie-ui/**/yarn.lock') }}- + - name: Install dependencies with Yarn run: sh scripts/build-ui.sh