Make oldest-ready task ordering SQL Server portable #1001
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build | |
| on: | |
| push: | |
| branches: [ master, v2 ] | |
| pull_request: | |
| branches: [ master, v2 ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| services: | |
| mysql: | |
| image: mysql | |
| env: | |
| MYSQL_ROOT_PASSWORD: password | |
| ports: | |
| - 3306:3306 | |
| postgres: | |
| image: postgres | |
| env: | |
| POSTGRES_USER: root | |
| POSTGRES_PASSWORD: password | |
| POSTGRES_DB: testbench | |
| ports: | |
| - 5432:5432 | |
| redis: | |
| image: redis | |
| ports: | |
| - 6379:6379 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 10 | |
| - name: Validate composer.json and composer.lock | |
| run: composer validate --strict | |
| - name: Cache Composer packages | |
| id: composer-cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php- | |
| - name: Install dependencies | |
| run: composer install --prefer-dist --no-progress | |
| - name: Check coding style via ECS | |
| run: vendor/bin/ecs check | |
| - name: Run static analysis via PHPStan | |
| run: vendor/bin/phpstan analyse src tests | |
| - name: Export GitHub Actions test defaults | |
| run: | | |
| echo "APP_KEY=base64:i3g6f+dV8FfsIkcxqd7gbiPn2oXk5r00sTmdD6V5utI=" >> "$GITHUB_ENV" | |
| echo "DB_HOST=127.0.0.1" >> "$GITHUB_ENV" | |
| echo "DB_DATABASE=testbench" >> "$GITHUB_ENV" | |
| echo "DB_USERNAME=root" >> "$GITHUB_ENV" | |
| echo "DB_PASSWORD=password" >> "$GITHUB_ENV" | |
| echo "QUEUE_FAILED_DRIVER=null" >> "$GITHUB_ENV" | |
| echo "REDIS_HOST=127.0.0.1" >> "$GITHUB_ENV" | |
| echo "REDIS_PASSWORD=" >> "$GITHUB_ENV" | |
| echo "REDIS_PORT=${{ job.services.redis.ports[6379] }}" >> "$GITHUB_ENV" | |
| - name: Create databases | |
| run: | | |
| touch testbench.sqlite | |
| mysql -e 'CREATE DATABASE testbench' -h127.0.0.1 -uroot -ppassword -P ${{ job.services.mysql.ports[3306] }} | |
| - name: Run test suite (MySQL) | |
| run: vendor/bin/phpunit --testdox --debug --testsuite feature | |
| env: | |
| DB_CONNECTION: mysql | |
| DB_PORT: ${{ job.services.mysql.ports[3306] }} | |
| QUEUE_CONNECTION: redis | |
| - name: Run test suite (PostgreSQL) | |
| run: vendor/bin/phpunit --testdox --debug --testsuite feature | |
| env: | |
| DB_CONNECTION: pgsql | |
| DB_PORT: ${{ job.services.postgres.ports[5432] }} | |
| QUEUE_CONNECTION: redis | |
| - name: Upload laravel.log if tests fail | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: laravel-log | |
| path: vendor/orchestra/testbench-core/laravel/storage/logs/laravel.log | |
| - name: Code Coverage | |
| run: | | |
| vendor/bin/phpunit --testdox --coverage-clover=coverage.xml --testsuite unit | |
| env: | |
| DB_CONNECTION: sqlite | |
| DB_DATABASE: testbench.sqlite | |
| QUEUE_CONNECTION: sync | |
| XDEBUG_MODE: coverage | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: ./coverage.xml | |
| fail_ci_if_error: false | |
| token: ${{ secrets.CODECOV_TOKEN }} |