fix(docker): resolve maryui asset build, qr hmac fallback, and imagick runtime #24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: 30 | |
| 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 | |
| - name: Copy .env | |
| run: php -r "file_exists('.env') || copy('.env.example', '.env');" | |
| - name: Generate key | |
| run: php artisan key:generate --no-interaction | |
| - name: Build frontend assets | |
| run: | | |
| npm ci | |
| npm run build | |
| - name: Test with PHPUnit | |
| run: php artisan test | |
| 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: 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 . |