FileNotFoundError: рабочий процесс действий Github завершается ошибкой при создании каталога или файла во время теста - PullRequest
1 голос
/ 01 мая 2020

Я использую рабочий процесс приложения Github Python для CI. Мое приложение создает папку для хранения временных файлов. Он отлично работает при тестировании на localhost, но не позволяет мне создать новый каталог в действиях Github. Я получаю следующее сообщение об ошибке:

@classmethod
def save_files(cls, files: list) -> str:
    """
    saves a list of files in the "files"
    folder in app
    :param files: list of FileStorage objects
    :return: directory name where files saved
    """
    folder = time.strftime("%Y%m%d-%H%M%S")
    folder_path = Path(__file__).parent / "files" / folder
    os.mkdir(folder_path)
    E    FileNotFoundError: [Errno 2] No such file or directory: /home/runner/work/DocumentAnalysisTool/DocumentAnalysisTool/app/files/20200430-235749

Вот мой файл pythonapp.yml рабочего процесса:

name: Python application

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python 3.8
      uses: actions/setup-python@v1
      with:
        python-version: 3.8
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements.txt
    - name: Lint with flake8
      run: |
        pip install flake8
        # stop the build if there are Python syntax errors or undefined names
        flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
        # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
        flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
    - name: Test with pytest
      run: |
        pip install pytest
        pytest

Заранее спасибо

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...