diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml deleted file mode 100644 index 9f48f335..00000000 --- a/.github/workflows/run-tests.yml +++ /dev/null @@ -1,45 +0,0 @@ -strategy: - fail-fast: true - matrix: - os: [ubuntu-latest] - php: [8.1, 8.2] - laravel: [10.*] - include: - - laravel: 10.* - testbench: 8.* - - laravel: 9.* - testbench: 7.* - exclude: - - php: 8.2 - laravel: 9.* - node-version: [16, 18, 20] - -name: run-tests - -jobs: - test: - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v3 - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo - coverage: none - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - name: Install dependencies - run: | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update - composer update --prefer-dist --no-interaction --no-progress - - name: npm install - run: npm install - - name: npm run build - run: npm run build - - name: Execute tests - run: vendor/bin/phpunit diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..e93c9cbc --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,45 @@ +name: Tests + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + + tests: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.3' + + + - name: Start database + run: sudo /etc/init.d/mysql start + + - name: Create database + run: mysql -e "CREATE DATABASE IF NOT EXISTS liberu;" -uroot -proot + + - name: Copy environment file + run: cp .env.testing .env + + - name: Install dependencies + run: composer install + + - name: Generate application key + run: php artisan key:generate + + - name: Run database migrations + run: php artisan migrate + + - name: Seed database + run: php artisan db:seed + + - name: Run tests + run: php artisan test