Github Action fails on testing Laravel 8

Viewed 691

GitHub action fails on laravel 8, using Laravel By GitHub Actions.

issue while running

composer install -q --no-ansi --no-interaction --no-scripts --prefer-dist

composer install -q --no-ansi --no-interaction --no-scripts --prefer-dist
  shell: /bin/bash -e {0}
Your lock file does not contain a compatible set of packages. Please run composer update.
Error: Process completed with exit code 2.

And it is also a fresh Laravel 8 project, runs on ubuntu-latest

My github action file,

name: Testsuit

on:
  push:
    branches: [ main, dev ]
  pull_request:
    branches: [ main, dev ]

jobs:
  laravel-tests:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: true
      matrix:
        os: [ubuntu-latest]
        php: [8]
        laravel: [8.*]
        stability: [prefer-lowest, prefer-stable]
        include:
          - laravel: 8.*
            testbench: 6.*
    name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2
      - name: Copy .env
        run: php -r "file_exists('.env') || copy('.env.example', '.env');"
      - name: Install Dependencies
        run: composer install -q --no-ansi --no-interaction --no-scripts --prefer-dist
      - name: Generate key
        run: php artisan key:generate
      - name: Directory Permissions
        run: chmod -R 777 storage bootstrap/cache
      - name: Create Database
        run: |
            mkdir -p database
            touch database/database.sqlite
      - name: Execute tests (Unit and Feature tests) via PHPUnit
        env:
          DB_CONNECTION: sqlite
          DB_DATABASE: database/database.sqlite
        run: vendor/bin/phpunit tests

And my composer json contains the defaults and some spatie packages, that's is running on my local machine.

How can I solve this?

0 Answers
Related