Initial Release #1
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 ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| services: | |
| mysql: | |
| image: mysql:8.0 | |
| env: | |
| MYSQL_ROOT_PASSWORD: secret | |
| MYSQL_DATABASE: flowboard_test | |
| ports: | |
| - 3306:3306 | |
| options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.2' | |
| extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, pdo_mysql, zip | |
| coverage: xdebug | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| cache: 'npm' | |
| - name: Install PHP dependencies | |
| run: composer install --no-progress --prefer-dist --optimize-autoloader | |
| - name: Install NPM dependencies | |
| run: npm ci | |
| - name: Build assets | |
| run: npm run build | |
| - name: Copy environment file | |
| run: cp .env.example .env | |
| - name: Generate application key | |
| run: php artisan key:generate | |
| - name: Create SQLite database | |
| run: touch database/database.sqlite | |
| - name: Run migrations | |
| run: php artisan migrate --env=testing | |
| - name: Run tests | |
| run: php artisan test --coverage | |
| - name: Run Pint (Code Style) | |
| run: vendor/bin/pint --test | |
| security: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.2' | |
| - name: Install dependencies | |
| run: composer install --no-progress --prefer-dist --optimize-autoloader | |
| - name: Run security check | |
| run: composer audit | |
| deploy: | |
| needs: [test, security] | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Deploy to production | |
| run: echo "Deploy to production server" | |
| # Add your deployment steps here |