Skip to content

Commit

Permalink
- setup
Browse files Browse the repository at this point in the history
  • Loading branch information
EwelinaSkrzypacz committed Nov 13, 2024
1 parent fe63b7b commit 05ef62d
Show file tree
Hide file tree
Showing 6 changed files with 167 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .env.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
APP_NAME=interns2024c
APP_ENV=testing
APP_KEY=base64:WVG2VcHt+a2uzCw7n1tVUBPyw2kof644d6EoYA/UUAg=
APP_DEBUG=false
APP_URL=http://interns2024c.blumilk.localhost

LOG_CHANNEL=stack
LOG_LEVEL=debug

BROADCAST_DRIVER=log
CACHE_DRIVER=array
FILESYSTEM_DISK=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=array
SESSION_LIFETIME=120
MAIL_MAILER=array

DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=interns2024c
DB_USERNAME=interns2024c
DB_PASSWORD=password
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@EwelinaSkrzypacz
12 changes: 12 additions & 0 deletions .github/workflows/check-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Check PR Title
on:
pull_request:
branches: [ "main" ]
types: [opened, edited, synchronize, ready_for_review, reopened]

jobs:
check-pr-title:
name: Check PR title
runs-on: ubuntu-latest
steps:
- uses: blumilksoftware/action-pr-title@e05fc76a1cc45b33644f1de51218be43ac121dd0 # v1.2.0 # https://github.com/blumilksoftware/action-pr-title
40 changes: 40 additions & 0 deletions .github/workflows/test-and-lint-js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Test & lint JS codebase

on:
pull_request:
branches: [ "main" ]
types: [opened, synchronize, reopened, ready_for_review]
paths:
- '**.js'
- '**.ts'
- '**.vue'
- 'package.json'
- 'package.lock'

jobs:
test-and-lint-js:
name: Test & lint JS codebase
timeout-minutes: 10
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 # https://github.com/actions/checkout

- name: Cache dependencies
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 # https://github.com/actions/cache
with:
path: node_modules
key: ${{ runner.os }}-npm-dependencies-${{ hashFiles('package.lock') }}
restore-keys: ${{ runner.os }}-npm-dependencies

- name: Set up node
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 # https://github.com/actions/setup-node
with:
node-version: 21

- name: Instal npm dependencies
run: npm clean-install

- name: Run JS linter
run: npm run lint
66 changes: 66 additions & 0 deletions .github/workflows/test-and-lint-php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Test & lint PHP codebase

on:
pull_request:
branches: [ "main" ]
types: [opened, synchronize, reopened, ready_for_review]
paths:
- '**.php'
- 'composer.json'
- 'composer.lock'
- 'phpunit.xml'
- 'env.ci'

jobs:
test-and-lint-php:
name: Test & lint PHP codebase
timeout-minutes: 10
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
services:
pgsql:
image: postgres:16.3-alpine3.18@sha256:64e18e8fb3e9c9aac89ac590c5dd8306b862478404f76cd9b5f7720d012b4c47 # https://hub.docker.com/_/postgres
env:
POSTGRES_DB: interns2024b
POSTGRES_USER: interns2024b
POSTGRES_PASSWORD: password
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 3s
--health-timeout 3s
--health-retries 5
ports:
- 5432:5432

steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 # https://github.com/actions/checkout

- name: Validate composer.json and composer.lock
run: composer validate

- name: Cache dependencies
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 # https://github.com/actions/cache
with:
path: vendor
key: ${{ runner.os }}-composer-dependencies-${{ hashFiles('composer.lock') }}
restore-keys: ${{ runner.os }}-composer-dependencies

- name: Setup PHP
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # 2.31.1 # https://github.com/shivammathur/setup-php
with:
php-version: 8.3
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_pgsql, intl
coverage: none

- name: Install Composer dependencies
run: composer install --prefer-dist --no-interaction

- name: Run PHP linter
run: composer cs

- name: Copy .env
run: cp .env.ci .env

- name: Execute tests
run: php artisan test --env=ci
25 changes: 25 additions & 0 deletions artisan
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env php
<?php

declare(strict_types=1);

define("LARAVEL_START", microtime(true));

require __DIR__ . "/vendor/autoload.php";

use Illuminate\Contracts\Console\Kernel;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Output\ConsoleOutput;

$app = require_once __DIR__ . "/bootstrap/app.php";

$kernel = $app->make(Kernel::class);

$status = $kernel->handle(
$input = new ArgvInput(),
new ConsoleOutput(),
);

$kernel->terminate($input, $status);

exit($status);

0 comments on commit 05ef62d

Please sign in to comment.