Skip to content

Composer install successfull, but Failed opening required 'vendor/autoload.php' on GitHub Action #25

@Bizarrus

Description

@Bizarrus

Source: https://github.com/fruithost/Documentation/blob/main/.github/workflows/documentation.yml

name: Run Tests

on:
    push:

jobs:
    run-tests:
        runs-on: ubuntu-latest
        
        env: 
              CI_COMMIT_MESSAGE: Build Module-Packages
              CI_COMMIT_AUTHOR: fruithost | Modules Builder
              
        strategy:
            matrix:
                php: [8.1]

        name: PHP ${{ matrix.php }}

        steps:
            - name: Checkout repository
              uses: actions/checkout@v2
              
            - name: Setup PHP
              uses: shivammathur/setup-php@v2
              with:
                  php-version: ${{ matrix.php-version }}
                  coverage: ${{ matrix.coverage }}
                  tools: composer:v2
                  ini-values: date.timezone='UTC'
            
            - name: Get Sources
              run: |
                git clone https://github.com/fruithost/Panel.git ./src/
                git clone https://github.com/fruithost/Documentation.wiki.git ./wiki/
                git clone https://github.com/clean/phpdoc-md.git ./phpdoc/

            - name: Create temporary Config file
              run: |
                    touch ./config.php
                    echo "<?php" >> ./config.php
                    echo "return (object)[" >> ./config.php
                    echo "'rootNamespace' => 'Clean\PhpDocMd\Example'," >> ./config.php
                    echo "'destDirectory' => 'docs'," >> ./config.php
                    echo "'format' => 'github'," >> ./config.php
                    echo "'destDirectory' => 'docs'," >> ./config.php
                    echo "'classes' => [" >> ./config.php
                    echo "'src\**'" >> ./config.php
                    echo "]];" >> ./config.php
                                 
            - name: Install dependencies
              run: |
                  composer install --working-dir=./phpdoc/ --prefer-dist --no-interaction --no-progress
                  
            - name: Generating documentation...
              run: |
                  ./phpdoc/bin/phpdoc-md -h
                  ./phpdoc/bin/phpdoc-md ./config.php
             
            - name: Commit changes
              if: github.event_name == 'push'
              run: |
                set -e
                cp ./build/ ./wiki/
                git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
                git config --global user.email "fruithost@users.noreply.github.com"
                git add .
                git diff-index --quiet HEAD || git commit -m "${{ env.CI_COMMIT_MESSAGE }}" && git push
PHP Warning:  require(vendor/autoload.php): Failed to open stream: No such file or directory in /home/runner/work/Documentation/Documentation/phpdoc/bin/phpdoc-md on line 7
PHP Fatal error:  Uncaught Error: Failed opening required 'vendor/autoload.php' (include_path='.:/usr/share/php') in /home/runner/work/Documentation/Documentation/phpdoc/bin/phpdoc-md:7
Stack trace:
#0 {main}
  thrown in /home/runner/work/Documentation/Documentation/phpdoc/bin/phpdoc-md on line 7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions