From 568bdee3ed75d05a52e90fad103b5a120ddb0b7e Mon Sep 17 00:00:00 2001 From: Brad Keryan Date: Fri, 18 Apr 2025 11:54:08 -0500 Subject: [PATCH 1/2] github: Simplify virtualenv caching --- .github/workflows/check_nitypes.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/check_nitypes.yml b/.github/workflows/check_nitypes.yml index 0b61127b..38373d35 100644 --- a/.github/workflows/check_nitypes.yml +++ b/.github/workflows/check_nitypes.yml @@ -26,20 +26,13 @@ jobs: poetry-version: ${{ env.POETRY_VERSION }} - name: Check for lock changes run: poetry check --lock - - name: Restore cached virtualenv - uses: actions/cache/restore@v4 - id: restore-nitypes + - name: Cache virtualenv + uses: actions/cache@v4 with: path: .venv key: nitypes-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }} - name: Install nitypes run: poetry install -v - - name: Save cached virtualenv - uses: actions/cache/save@v4 - if: steps.restore-nitypes.outputs.cache-hit != 'true' - with: - path: .venv - key: ${{ steps.restore-nitypes.outputs.cache-primary-key }} - name: Lint run: poetry run ni-python-styleguide lint - name: Mypy static analysis (Linux) From 0ebd80c4a5bfcae1510368d16e176b346db7d41d Mon Sep 17 00:00:00 2001 From: Brad Keryan Date: Fri, 18 Apr 2025 11:54:53 -0500 Subject: [PATCH 2/2] github: Simplify virtualenv caching --- .github/workflows/run_unit_tests.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/run_unit_tests.yml b/.github/workflows/run_unit_tests.yml index f9fedafd..e165cbf2 100644 --- a/.github/workflows/run_unit_tests.yml +++ b/.github/workflows/run_unit_tests.yml @@ -30,20 +30,13 @@ jobs: uses: Gr1N/setup-poetry@v9 with: poetry-version: ${{ env.POETRY_VERSION }} - - name: Restore cached virtualenv - uses: actions/cache/restore@v4 - id: restore-nitypes + - name: Cache virtualenv + uses: actions/cache@v4 with: path: .venv key: nitypes-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }} - name: Install nitypes run: poetry install -v - - name: Save cached virtualenv - uses: actions/cache/save@v4 - if: steps.restore-nitypes.outputs.cache-hit != 'true' - with: - path: .venv - key: ${{ steps.restore-nitypes.outputs.cache-primary-key }} - name: Run unit tests and code coverage run: poetry run pytest ./tests/unit -v --cov=nitypes --junitxml=test_results/nitypes-${{ matrix.os }}-py${{ matrix.python-version }}.xml - name: Upload test results