From 0860a2dc2d8f981827d1de874b63e97aad8271f2 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Tue, 9 Nov 2021 10:53:00 +0300 Subject: [PATCH] work on fixing errors --- .github/workflows/e2e-cache.yml | 10 ++-------- src/cache-distributions/cache-distributor.ts | 5 ++++- src/cache-save.ts | 10 ++++++---- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/workflows/e2e-cache.yml b/.github/workflows/e2e-cache.yml index a7531ffc..13d57cbc 100644 --- a/.github/workflows/e2e-cache.yml +++ b/.github/workflows/e2e-cache.yml @@ -22,8 +22,6 @@ jobs: python-version: ['3.7', '3.8', '3.9', 'pypy-3.7-v7.3.5', 'pypy-3.7-v7.x', 'pypy-2.7-v7.3.4'] steps: - uses: actions/checkout@v2 - - name: Clean global cache - run: pip cache purge - name: Setup Python uses: ./ with: @@ -50,8 +48,7 @@ jobs: python-version: ${{ matrix.python-version }} cache: 'pipenv' - name: Install dependencies - run: pipenv install - working-directory: __tests__/data + run: pipenv install flake8 python-pip-depencies-caching-path: name: Test pip (Python ${{ matrix.python-version}}, ${{ matrix.os }}) @@ -63,8 +60,6 @@ jobs: python-version: ['3.7', '3.8', '3.9', 'pypy-3.7-v7.3.5', 'pypy-3.7-v7.x', 'pypy-2.7-v7.3.4'] steps: - uses: actions/checkout@v2 - - name: Clean global cache - run: pip cache purge - name: Setup Python uses: ./ with: @@ -93,5 +88,4 @@ jobs: cache: 'pipenv' cache-dependency-path: '**/requirements-linux.txt' - name: Install dependencies - run: pipenv install - working-directory: __tests__/data \ No newline at end of file + run: pipenv install flake8 \ No newline at end of file diff --git a/src/cache-distributions/cache-distributor.ts b/src/cache-distributions/cache-distributor.ts index b823bfa8..ef0be0ef 100644 --- a/src/cache-distributions/cache-distributor.ts +++ b/src/cache-distributions/cache-distributor.ts @@ -9,7 +9,10 @@ export enum State { abstract class CacheDistributor { protected CACHE_KEY_PREFIX = 'setup-python'; - constructor(protected packageManager: string, protected cacheDependencyPath: string) {} + constructor( + protected packageManager: string, + protected cacheDependencyPath: string + ) {} protected abstract getCacheGlobalDirectories(): Promise; protected abstract computeKeys(): Promise<{ diff --git a/src/cache-save.ts b/src/cache-save.ts index bf73613f..0f9d0372 100644 --- a/src/cache-save.ts +++ b/src/cache-save.ts @@ -17,14 +17,16 @@ export async function run() { } async function saveCache(packageManager: string) { - const cachePaths = JSON.parse( - core.getState(State.CACHE_PATHS) - ) as string[]; + const cachePaths = JSON.parse(core.getState(State.CACHE_PATHS)) as string[]; core.debug(`paths for caching are ${cachePaths.join(', ')}`); if (!isCacheDirectoryExists(cachePaths)) { - throw new Error(`Cache folder path is retrieved for ${packageManager} but doesn't exist on disk: ${cachePaths.join(', ')}`); + throw new Error( + `Cache folder path is retrieved for ${packageManager} but doesn't exist on disk: ${cachePaths.join( + ', ' + )}` + ); } const primaryKey = core.getState(State.STATE_CACHE_PRIMARY_KEY);