diff --git a/.env.example b/.env.example index ea0665b..7186b36 100644 --- a/.env.example +++ b/.env.example @@ -1,19 +1,19 @@ -APP_NAME=Laravel +APP_NAME=Trakli APP_ENV=local APP_KEY= APP_DEBUG=true -APP_URL=http://localhost +APP_URL=http://localhost:8000 LOG_CHANNEL=stack LOG_DEPRECATIONS_CHANNEL=null LOG_LEVEL=debug DB_CONNECTION=mysql -DB_HOST=127.0.0.1 +DB_HOST=mysql DB_PORT=3306 -DB_DATABASE=laravel -DB_USERNAME=root -DB_PASSWORD= +DB_DATABASE=trakli +DB_USERNAME=trakli +DB_PASSWORD=secret BROADCAST_DRIVER=log CACHE_DRIVER=file @@ -34,7 +34,7 @@ MAIL_PORT=1025 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null -MAIL_FROM_ADDRESS="hello@example.com" +MAIL_FROM_ADDRESS="hello@trakli.io" MAIL_FROM_NAME="${APP_NAME}" AWS_ACCESS_KEY_ID= diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 0000000..22ca4cc --- /dev/null +++ b/.github/workflows/checks.yml @@ -0,0 +1,85 @@ +name: Checks + +on: + push: + branches: + - main + - 'feature/*' + pull_request: + branches: + - main + +jobs: + lint: + name: Lint with Pint + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + tools: composer + + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-suggest --no-interaction + + - name: Run Pint + run: vendor/bin/pint + + test: + name: Run Tests + runs-on: ubuntu-latest + + services: + mysql: + image: mysql:8.0 + env: + MYSQL_ROOT_PASSWORD: secret + MYSQL_DATABASE: trakli + ports: + - 3306:3306 + options: >- + --health-cmd="mysqladmin ping --silent" + --health-interval=10s + --health-timeout=5s + --health-retries=3 + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + tools: composer + + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-suggest --no-interaction + + - name: Copy .env file + run: cp .env.example .env + - name: Update .env file + run: | + sed -i 's/DB_HOST=mysql/DB_HOST=127.0.0.1/' .env + sed -i 's/DB_PORT=3306/DB_PORT=3306/' .env + sed -i 's/DB_DATABASE=trakli/DB_DATABASE=trakli/' .env + sed -i 's/DB_USERNAME=trakli/DB_USERNAME=root/' .env + + - name: Generate application key + run: php artisan key:generate + + - name: Configure database + run: | + php artisan config:clear + php artisan config:cache + + - name: Run migrations + run: php artisan migrate --seed + + - name: Run tests + run: php artisan test diff --git a/composer.json b/composer.json index 8a3d72d..7cf7e47 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ }, "require-dev": { "fakerphp/faker": "^1.9.1", - "laravel/pint": "^1.0", + "laravel/pint": "^1.16", "laravel/sail": "^1.18", "mockery/mockery": "^1.4.4", "nunomaduro/collision": "^7.0", diff --git a/composer.lock b/composer.lock index b29815d..142303b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9c491b8531eec05ba41a11d9276a5749", + "content-hash": "b398cc70c8bcc2246f88cf3293ccb5ad", "packages": [ { "name": "brick/math", diff --git a/docker-compose.yml b/docker-compose.yml index 3d35981..f3c2f7b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,13 +6,12 @@ services: command: bash -c " apt update -y && apt install git -y - && tail -f /dev/null - " + && tail -f /dev/null" tty: true environment: DISABLE_AUTORUN_COMPOSER_INSTALL: 1 - MAINTAINER: 'folks@whilesmart.com' - APP_USER: 'folks' + MAINTAINER: 'trakli@whilesmart.com' + APP_USER: 'trakli' volumes: - '.:/var/www/html' - '~/.ssh:/root/.ssh:ro' @@ -20,6 +19,7 @@ services: - sail depends_on: - mysql + mysql: image: 'mysql:8.0' ports: