mirror of
https://github.com/actions/setup-python.git
synced 2025-04-24 15:32:13 +00:00
work on fixing errors
This commit is contained in:
parent
b321c7b928
commit
0860a2dc2d
3 changed files with 12 additions and 13 deletions
10
.github/workflows/e2e-cache.yml
vendored
10
.github/workflows/e2e-cache.yml
vendored
|
@ -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']
|
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:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Clean global cache
|
|
||||||
run: pip cache purge
|
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
|
@ -50,8 +48,7 @@ jobs:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
cache: 'pipenv'
|
cache: 'pipenv'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pipenv install
|
run: pipenv install flake8
|
||||||
working-directory: __tests__/data
|
|
||||||
|
|
||||||
python-pip-depencies-caching-path:
|
python-pip-depencies-caching-path:
|
||||||
name: Test pip (Python ${{ matrix.python-version}}, ${{ matrix.os }})
|
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']
|
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:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Clean global cache
|
|
||||||
run: pip cache purge
|
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
|
@ -93,5 +88,4 @@ jobs:
|
||||||
cache: 'pipenv'
|
cache: 'pipenv'
|
||||||
cache-dependency-path: '**/requirements-linux.txt'
|
cache-dependency-path: '**/requirements-linux.txt'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pipenv install
|
run: pipenv install flake8
|
||||||
working-directory: __tests__/data
|
|
|
@ -9,7 +9,10 @@ export enum State {
|
||||||
|
|
||||||
abstract class CacheDistributor {
|
abstract class CacheDistributor {
|
||||||
protected CACHE_KEY_PREFIX = 'setup-python';
|
protected CACHE_KEY_PREFIX = 'setup-python';
|
||||||
constructor(protected packageManager: string, protected cacheDependencyPath: string) {}
|
constructor(
|
||||||
|
protected packageManager: string,
|
||||||
|
protected cacheDependencyPath: string
|
||||||
|
) {}
|
||||||
|
|
||||||
protected abstract getCacheGlobalDirectories(): Promise<string[]>;
|
protected abstract getCacheGlobalDirectories(): Promise<string[]>;
|
||||||
protected abstract computeKeys(): Promise<{
|
protected abstract computeKeys(): Promise<{
|
||||||
|
|
|
@ -17,14 +17,16 @@ export async function run() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function saveCache(packageManager: string) {
|
async function saveCache(packageManager: string) {
|
||||||
const cachePaths = JSON.parse(
|
const cachePaths = JSON.parse(core.getState(State.CACHE_PATHS)) as string[];
|
||||||
core.getState(State.CACHE_PATHS)
|
|
||||||
) as string[];
|
|
||||||
|
|
||||||
core.debug(`paths for caching are ${cachePaths.join(', ')}`);
|
core.debug(`paths for caching are ${cachePaths.join(', ')}`);
|
||||||
|
|
||||||
if (!isCacheDirectoryExists(cachePaths)) {
|
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);
|
const primaryKey = core.getState(State.STATE_CACHE_PRIMARY_KEY);
|
||||||
|
|
Loading…
Add table
Reference in a new issue