Skip to content

Commit

Permalink
chore: add linter
Browse files Browse the repository at this point in the history
  • Loading branch information
smarcet committed Jul 12, 2024
1 parent 4eb9c60 commit 10cc262
Show file tree
Hide file tree
Showing 4 changed files with 273 additions and 4 deletions.
105 changes: 105 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# This is a basic workflow to help you get started with Actions

name: Unit Tests On Push

# Controls when the workflow will run
on: push

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "unit-tests"
unit-tests:
# The type of runner that the job will run on
runs-on: ubuntu-latest
env:
APP_ENV: testing
APP_DEBUG: true
APP_KEY: base64:4vh0op/S1dAsXKQ2bbdCfWRyCI9r8NNIdPXyZWt9PX4=
DEV_EMAIL_TO: [email protected]
APP_URL: http://localhost
DB_CONNECTION: model
DB_HOST: 127.0.0.1
DB_PORT: 3306
DB_DATABASE: api_config
DB_USERNAME: root
DB_PASSWORD: 1qaz2wsx
SS_DB_HOST: 127.0.0.1
SS_DB_PORT: 3310
SS_DATABASE: api_model
SS_DB_USERNAME: root
SS_DB_PASSWORD: 1qaz2wsx
REDIS_HOST: 127.0.0.1
REDIS_PORT: 6379
REDIS_DB: 0
REDIS_PASSWORD: 1qaz2wsx
REDIS_DATABASES: 16
SSL_ENABLED: false
SESSION_DRIVER: redis
PHP_VERSION: 8.3
CACHE_DRIVER: redis
SESSION_COOKIE_DOMAIN: localhost
SESSION_COOKIE_SECURE: false
QUEUE_DRIVER: redis
REGISTRATION_DEFAULT_PAYMENT_PROVIDER: Stripe
REGISTRATION_DEFAULT_STRIPE_TEST_MODE: true
REGISTRATION_DEFAULT_LIVE_STRIPE_PRIVATE_KEY:
REGISTRATION_DEFAULT_LIVE_STRIPE_PUBLISHABLE_KEY:
REGISTRATION_DEFAULT_LIVE_WEBHOOK_SECRET:
REGISTRATION_DEFAULT_TEST_STRIPE_PRIVATE_KEY: sk_test_12345
REGISTRATION_DEFAULT_TEST_STRIPE_PUBLISHABLE_KEY: pk_12345
REGISTRATION_DEFAULT_TEST_WEBHOOK_SECRET: whsec_12345
BOOKABLE_ROOMS_DEFAULT_PAYMENT_PROVIDER: Stripe
BOOKABLE_ROOMS_DEFAULT_STRIPE_TEST_MODE: true
BOOKABLE_ROOMS_DEFAULT_LIVE_STRIPE_PRIVATE_KEY:
BOOKABLE_ROOMS_DEFAULT_LIVE_STRIPE_PUBLISHABLE_KEY:
BOOKABLE_ROOMS_DEFAULT_LIVE_WEBHOOK_SECRET:
BOOKABLE_ROOMS_DEFAULT_TEST_STRIPE_PRIVATE_KEY: sk_test_12345
BOOKABLE_ROOMS_DEFAULT_TEST_STRIPE_PUBLISHABLE_KEY: pk_12345
BOOKABLE_ROOMS_DEFAULT_TEST_WEBHOOK_SECRET: whsec_12345
REGISTRATION_VALIDATE_TICKET_TYPE_REMOVAL: false
services:
mysql_api_model:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: ${{env.SS_DB_PASSWORD}}
MYSQL_DATABASE: ${{env.SS_DATABASE}}
ports:
- 3310:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=10 --name=mysql_api_model
mysql_api_config:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: ${{env.DB_PASSWORD}}
MYSQL_DATABASE: ${{env.DB_DATABASE}}
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=10

steps:
- name: Create Redis
uses: supercharge/[email protected]
with:
redis-port: ${{env.REDIS_PORT}}
redis-password: ${{env.REDIS_PASSWORD}}
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v4
- name: Change MYSQL sql_mode
run: >
docker exec mysql_api_model mysql -u root --password=${{env.SS_DB_PASSWORD}} -e "SET GLOBAL sql_mode = 'NO_ENGINE_SUBSTITUTION';"
- name: Install PHP
uses: "shivammathur/setup-php@v2"
with:
php-version: ${{env.PHP_VERSION}}
extensions: pdo_mysql, mbstring, exif, pcntl, bcmath, sockets, gettext
- name: Install dependencies
uses: "ramsey/composer-install@v3"
env:
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.COMPOSER_AUTH_TOKEN }}"} }'
- name: 'Run Tests'
run: |
./update_doctrine.sh
php artisan db:create_test_db --schema=config
php artisan db:create_test_db --schema=model
php artisan doctrine:migrations:migrate --no-interaction --em model
vendor/bin/parallel-lint --blame --exclude .git --exclude vendor .
File renamed without changes.
8 changes: 5 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@
"laminas/laminas-math": "^3.7"
},
"require-dev": {
"filp/whoops": "^2.0",
"spatie/laravel-ignition": "^2.8.0",
"fakerphp/faker": "^1.23",
"filp/whoops": "^2.0",
"laravel/browser-kit-testing": "7.2.0",
"mockery/mockery": "^1.6",
"php-parallel-lint/php-console-highlighter": "^1.0",
"php-parallel-lint/php-parallel-lint": "^1.4",
"phpunit/phpunit": "^11.0.1",
"laravel/browser-kit-testing": "7.2.0"
"spatie/laravel-ignition": "^2.8.0"
},
"suggest":{
"lib-openssl": "Required to use AES algorithms (except AES GCM)",
Expand Down
164 changes: 163 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 10cc262

Please sign in to comment.