🎥 Adds a new Label Editor #9091
Workflow file for this run
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: Tests in MySQL | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - develop | |
| pull_request: | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| services: | |
| mysql: | |
| image: mysql:5.7 | |
| env: | |
| MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
| MYSQL_DATABASE: snipeit | |
| ports: | |
| - 33306:3306 | |
| options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-version: | |
| - "8.2" | |
| - "8.3" | |
| - "8.4" | |
| - "8.5" | |
| name: PHP ${{ matrix.php-version }} | |
| steps: | |
| - uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2 | |
| with: | |
| php-version: "${{ matrix.php-version }}" | |
| coverage: none | |
| # ParaTest spawns a worker per core as a separate PHP process | |
| # and forwards ini flags only via --passthru-php, so bump the | |
| # memory limit here when setting up PHP rather than | |
| # on the test command. | |
| ini-values: memory_limit=1G | |
| - uses: actions/checkout@v7 | |
| with: | |
| persist-credentials: false | |
| - name: Get Composer Cache Directory | |
| id: composer-cache | |
| run: | | |
| echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@v6 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ matrix.php-version }}-composer- | |
| - name: Copy .env | |
| run: | | |
| cp -v .env.testing.example .env | |
| cp -v .env.testing.example .env.testing | |
| - name: Install Dependencies | |
| run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | |
| - name: Setup Laravel | |
| env: | |
| DB_CONNECTION: mysql | |
| DB_DATABASE: snipeit | |
| DB_PORT: ${{ job.services.mysql.ports[3306] }} | |
| DB_USERNAME: root | |
| run: | | |
| php artisan key:generate | |
| php artisan migrate --force | |
| php artisan passport:install --no-interaction | |
| chmod -R 777 storage bootstrap/cache | |
| - name: Execute tests (Unit and Feature tests) via PHPUnit | |
| env: | |
| DB_CONNECTION: mysql | |
| DB_DATABASE: snipeit | |
| DB_PORT: ${{ job.services.mysql.ports[3306] }} | |
| DB_USERNAME: root | |
| LOG_CHANNEL: single | |
| LOG_LEVEL: debug | |
| run: php artisan test --parallel | |
| - name: Upload Laravel logs as artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: laravel-logs-php-${{ matrix.php-version }}-run-${{ github.run_attempt }} | |
| path: | | |
| storage/logs/*.log | |
| if-no-files-found: ignore | |
| retention-days: 7 |