Skip to content

docs(11): commit ADRs 0013/0014 and phase patterns map #8

docs(11): commit ADRs 0013/0014 and phase patterns map

docs(11): commit ADRs 0013/0014 and phase patterns map #8

Workflow file for this run

name: CI
on:
push:
branches: [ "main", "develop" ]
pull_request:
branches: [ "main", "develop" ]
permissions:
contents: read
jobs:
migrations:
name: Migration Sanity Check
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-laravel
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Create Database
run: |
mkdir -p database
touch database/database.sqlite
- name: Run migrations fresh
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: php artisan migrate:fresh --force --no-interaction
lint:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-laravel
- name: Check formatting with Pint
run: vendor/bin/pint --test
typecheck:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-laravel
- name: Typecheck with PHPStan (Larastan, level 5 + baseline)
run: vendor/bin/phpstan analyse --no-progress --memory-limit=1G
test:
runs-on: ubuntu-latest
timeout-minutes: 45
env:
APP_ENV: testing
DB_CONNECTION: sqlite
DB_DATABASE: ':memory:'
CACHE_STORE: array
QUEUE_CONNECTION: sync
SESSION_DRIVER: array
MAIL_MAILER: array
QR_HMAC_SECRET: testing-hmac-secret-at-least-16-chars
PULSE_ENABLED: false
TELESCOPE_ENABLED: false
NIGHTWATCH_ENABLED: false
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-laravel
with:
coverage: 'true'
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Generate key
run: php artisan key:generate --no-interaction
- name: Test with PHPUnit (with coverage)
run: php artisan test --coverage-clover coverage.xml
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage.xml
sonarcloud:
name: SonarCloud quality gate
runs-on: ubuntu-latest
needs: [test]
timeout-minutes: 20
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Download coverage report
uses: actions/download-artifact@v4
with:
name: coverage
- name: SonarCloud Scan
# sonarcloud-github-action is archived; the maintained replacement is
# sonarqube-scan-action (pinned to the v8.2.1 commit).
uses: SonarSource/sonarqube-scan-action@22918119ff8e1ca75a623e15c8296b6ea4fbe28f # v8.2.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
build:
runs-on: ubuntu-latest
needs: [migrations, lint, typecheck, test]
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Build Docker image
run: docker build -t ceit-library:ci .