fix: compact carried-over badge instead of multi-line hint #116
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: [master] | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| php: | |
| name: PHP ${{ matrix.php }} | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: budget | |
| strategy: | |
| matrix: | |
| php: ['8.1', '8.2', '8.3'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up PHP ${{ matrix.php }} | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: bcmath | |
| coverage: none | |
| - name: Install dependencies | |
| run: composer install --no-interaction --prefer-dist | |
| - name: PHP syntax check | |
| run: composer lint | |
| - name: Validate migration names | |
| run: | | |
| FAIL=0 | |
| # Table names: oc_ prefix + name must be ≤ 27 chars, so name ≤ 23 | |
| for name in $(grep -ohP "createTable\('\K[^']+" lib/Migration/*.php 2>/dev/null); do | |
| if [ ${#name} -gt 23 ]; then | |
| echo "::error::Table '$name' is ${#name} chars (max 23, becomes oc_$name = $((${#name}+3)))" | |
| FAIL=1 | |
| fi | |
| done | |
| # Index names: same limit | |
| for name in $(grep -ohP "(?:addIndex|addUniqueIndex)\([^,]+,\s*'\K[^']+" lib/Migration/*.php 2>/dev/null); do | |
| if [ ${#name} -gt 23 ]; then | |
| echo "::error::Index '$name' is ${#name} chars (max 23, becomes oc_$name = $((${#name}+3)))" | |
| FAIL=1 | |
| fi | |
| done | |
| exit $FAIL | |
| - name: Run tests | |
| run: composer test:unit | |
| js: | |
| name: JS Build & Lint | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: budget | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| cache-dependency-path: budget/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Lint | |
| run: npm run lint | |
| - name: Build | |
| run: npm run build |