From 2a3915438c82ffa8f880f0a1e496adb3af807bdf Mon Sep 17 00:00:00 2001 From: Jason Liu Date: Mon, 19 Feb 2024 23:55:38 -0500 Subject: [PATCH] chore(github-actions): simplify caching and reorder setup steps (#453) --- .github/workflows/evals.yml | 9 +-------- .github/workflows/mkdocs.yml | 15 ++++----------- .github/workflows/test.yml | 21 +++++++-------------- .github/workflows/test_docs.yml | 15 ++++----------- 4 files changed, 16 insertions(+), 44 deletions(-) diff --git a/.github/workflows/evals.yml b/.github/workflows/evals.yml index 62f9014..d054d1b 100644 --- a/.github/workflows/evals.yml +++ b/.github/workflows/evals.yml @@ -20,14 +20,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: 3.11 - - - name: Cache Poetry virtualenv - uses: actions/cache@v3 - with: - path: ~/.cache/pypoetry/virtualenvs - key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} - restore-keys: | - ${{ runner.os }}-poetry- + cache: 'poetry' - name: Install Poetry uses: snok/install-poetry@v1.3.1 diff --git a/.github/workflows/mkdocs.yml b/.github/workflows/mkdocs.yml index 46022b1..d1a41e5 100644 --- a/.github/workflows/mkdocs.yml +++ b/.github/workflows/mkdocs.yml @@ -15,22 +15,15 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 + + - name: Install Poetry + uses: snok/install-poetry@v1.3.1 - name: Setup Python uses: actions/setup-python@v4 with: python-version: '3.10' - - - name: Cache Poetry virtualenv - uses: actions/cache@v3 - with: - path: ~/.cache/pypoetry/virtualenvs - key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} - restore-keys: | - ${{ runner.os }}-poetry- - - - name: Install Poetry - uses: snok/install-poetry@v1.3.1 + cache: 'poetry' - name: Install APT packages run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 62c3c3d..2538501 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,23 +15,16 @@ jobs: steps: - uses: actions/checkout@v2 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache Poetry virtualenv - uses: actions/cache@v3 - with: - path: ~/.cache/pypoetry/virtualenvs - key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} - restore-keys: | - ${{ runner.os }}-poetry- - + - name: Install Poetry uses: snok/install-poetry@v1.3.1 + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + cache: 'poetry' + - name: Install dependencies run: poetry install --with dev diff --git a/.github/workflows/test_docs.yml b/.github/workflows/test_docs.yml index fabfd16..3139ec3 100644 --- a/.github/workflows/test_docs.yml +++ b/.github/workflows/test_docs.yml @@ -15,21 +15,14 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Install Poetry + uses: snok/install-poetry@v1.3.1 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - - name: Cache Poetry virtualenv - uses: actions/cache@v3 - with: - path: ~/.cache/pypoetry/virtualenvs - key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} - restore-keys: | - ${{ runner.os }}-poetry- - - - name: Install Poetry - uses: snok/install-poetry@v1.3.1 + cache: 'poetry' - name: Install dependencies run: poetry install --with dev,docs,test-docs