diff --git a/.env.example b/.env.example index 9504186ea..ec4a3985a 100644 --- a/.env.example +++ b/.env.example @@ -4,14 +4,6 @@ APP_KEY= APP_DEBUG=false APP_URL=http://localhost -FORCE_HTTPS=false - -CONTENT_WIDTH=7xl - -DASHBOARD_POLLING=60 -NOTIFICATION_POLLING=60 -RESULTS_POLLING=false - LOG_CHANNEL=stack LOG_DEPRECATIONS_CHANNEL=null LOG_LEVEL=debug @@ -39,10 +31,4 @@ MAIL_ENCRYPTION=null MAIL_FROM_ADDRESS="hello@example.com" MAIL_FROM_NAME="Speedtest Tracker" -AWS_ACCESS_KEY_ID= -AWS_SECRET_ACCESS_KEY= -AWS_DEFAULT_REGION=us-east-1 -AWS_BUCKET= -AWS_USE_PATH_STYLE_ENDPOINT=false - TELEGRAM_BOT_TOKEN=null diff --git a/.env.testing b/.env.testing new file mode 100644 index 000000000..15111c937 --- /dev/null +++ b/.env.testing @@ -0,0 +1,34 @@ +APP_NAME="Speedtest Tracker" +APP_ENV=local +APP_KEY=base64:Tx3xYzxoL/5LmKHYr9QXlbnhTDVE1GK5T7tzxpovHaY= +APP_DEBUG=true +APP_URL=http://localhost + +LOG_CHANNEL=stack +LOG_DEPRECATIONS_CHANNEL=null +LOG_LEVEL=debug + +DB_CONNECTION=mysql +DB_HOST=127.0.0.1 +DB_PORT=3306 +DB_DATABASE=testing +DB_USERNAME=root +DB_PASSWORD= + +BROADCAST_DRIVER=log +CACHE_DRIVER=file +FILESYSTEM_DISK=local +QUEUE_CONNECTION=database +SESSION_DRIVER=database +SESSION_LIFETIME=1440 + +MAIL_MAILER=smtp +MAIL_HOST=mailhog +MAIL_PORT=1025 +MAIL_USERNAME=null +MAIL_PASSWORD=null +MAIL_ENCRYPTION=null +MAIL_FROM_ADDRESS="hello@example.com" +MAIL_FROM_NAME="Speedtest Tracker" + +TELEGRAM_BOT_TOKEN=null diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 047fe404f..b0c8b61b9 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,20 +4,24 @@ updates: directory: "/" schedule: interval: "weekly" + day: "thursday" labels: - "😑 dependencies" - "🐋 docker" + reviewers: + - "alexjustesen" + commit-message: + prefix: "docker" + - package-ecosystem: "github-actions" directory: "/" schedule: interval: "weekly" + day: "thursday" labels: - "😑 dependencies" - "🧑‍💻 github actions" - # - package-ecosystem: "composer" - # directory: "/" - # schedule: - # interval: "weekly" - # labels: - # - "😑 dependencies" - # - "🐘 php" + reviewers: + - "alexjustesen" + commit-message: + prefix: "gh actions" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index e99a69a05..000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Lint - -on: - push: - pull_request: - workflow_dispatch: - -jobs: - duster: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: "duster" - uses: tighten/duster-action@v2 - with: - args: lint --using=pint diff --git a/.github/workflows/test.yml b/.github/workflows/tests.yml similarity index 64% rename from .github/workflows/test.yml rename to .github/workflows/tests.yml index 9a319ee07..009709f65 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/tests.yml @@ -1,70 +1,88 @@ -name: Test +# .github/workflows/tests.yml +name: Tests on: push: branches: - '!main' - '!release-**' + pull_request: workflow_dispatch: jobs: + lint: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v3 + - name: "duster" + uses: tighten/duster-action@v2 + with: + args: lint --using=pint + test: - strategy: - matrix: - operating-system: - - ubuntu-latest - php-version: - - '8.2' - name: php ${{ matrix.php-version }} on ${{ matrix.operating-system }} + needs: [lint] # needs lint job to pass first + + runs-on: ubuntu-22.04 + services: mysql: image: mysql:8.0 env: MYSQL_ALLOW_EMPTY_PASSWORD: yes - MYSQL_DATABASE: test + MYSQL_DATABASE: testing ports: - 3306:3306 options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - runs-on: ${{ matrix.operating-system }} + steps: - name: Checkout uses: actions/checkout@v3 + - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: ${{ matrix.php-version }} - extensions: bcmath, ctype, fileinfo, json, mbstring, openssl, pdo, tokenizer, xml - coverage: xdebug + php-version: '8.2' + - name: Prepare the environment - run: cp .env.example .env + run: cp .env.testing .env + - name: Get composer cache directory id: composer-cache run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + - name: Setup composer cache uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }} restore-keys: ${{ runner.os }}-composer- + - name: Install composer dependencies - env: - COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }} - run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist - - name: Install application + run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist + + - name: Install npm dependencies and build assets + run: npm ci && npm run build + + - name: Directory permissions + run: chmod -R 777 storage bootstrap/cache + + - name: Test application install run: php artisan app:install --force env: DB_CONNECTION: mysql DB_HOST: 127.0.0.1 DB_PORT: ${{ job.services.mysql.ports['3306'] }} + DB_DATABASE: testing DB_USERNAME: root - DB_DATABASE: test DB_PASSWORD: null + - name: Run tests run: php artisan test env: DB_CONNECTION: mysql DB_HOST: 127.0.0.1 DB_PORT: ${{ job.services.mysql.ports['3306'] }} + DB_DATABASE: testing DB_USERNAME: root - DB_DATABASE: test DB_PASSWORD: null diff --git a/composer.lock b/composer.lock index 34275d17c..e51e7d1d4 100644 --- a/composer.lock +++ b/composer.lock @@ -11992,29 +11992,29 @@ }, { "name": "tightenco/duster", - "version": "v2.7.2", + "version": "v2.7.3", "source": { "type": "git", "url": "https://github.com/tighten/duster.git", - "reference": "84fcb71992b6a70c1741f056ed17ae14dd9c847f" + "reference": "6d1a598bd3cc13d61e7cda17b4ae4deffce0e0e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tighten/duster/zipball/84fcb71992b6a70c1741f056ed17ae14dd9c847f", - "reference": "84fcb71992b6a70c1741f056ed17ae14dd9c847f", + "url": "https://api.github.com/repos/tighten/duster/zipball/6d1a598bd3cc13d61e7cda17b4ae4deffce0e0e4", + "reference": "6d1a598bd3cc13d61e7cda17b4ae4deffce0e0e4", "shasum": "" }, "require": { "php": "^8.1.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.21.1", - "laravel-zero/framework": "^10.1.1", - "laravel/pint": "^v1.11.0", - "nunomaduro/termwind": "^1.15.1", + "friendsofphp/php-cs-fixer": "^3.46", + "laravel-zero/framework": "^10.3", + "laravel/pint": "^1.13", + "nunomaduro/termwind": "^1.15", "spatie/invade": "^1.1", - "squizlabs/php_codesniffer": "^3.7.2", - "tightenco/tlint": "^9.0" + "squizlabs/php_codesniffer": "^3.8", + "tightenco/tlint": "^9.2" }, "bin": [ "builds/duster" @@ -12058,7 +12058,7 @@ "issues": "https://github.com/tighten/duster/issues", "source": "https://github.com/tighten/duster" }, - "time": "2024-01-05T20:30:54+00:00" + "time": "2024-01-12T23:26:01+00:00" } ], "aliases": [], diff --git a/pint.json b/pint.json index ae878f221..818cc63b8 100644 --- a/pint.json +++ b/pint.json @@ -3,7 +3,7 @@ "exclude": [ "config" ], - "notName": [ - "server.php" - ] + "rules": { + "fully_qualified_strict_types": false + } }