phug-php/phug

View on GitHub
.github/workflows/split.yml

Summary

Maintainability
Test Coverage
name: Split

on:
  push:
    branches: [ '**' ]
  pull_request:
    branches: [ '**' ]

jobs:
  split:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: 8.2
        tools: composer:v2

    - name: Cache Composer packages
      id: composer-cache
      uses: actions/cache@v2
      with:
        path: vendor
        key: split-${{ hashFiles('**/composer.lock') }}
        restore-keys: |
          split-

    - name: Install dependencies
      if: steps.composer-cache.outputs.cache-hit != 'true'
      run: |
        test -f composer.json && mv composer.json composer.json.save -f
        composer require phug/split --no-interaction
        test -f composer.json.save && mv composer.json.save composer.json -f

    - name: Split monorepository
      run: vendor/bin/split update --git-credentials=$REPOSITORY_CREDENTIALS
      env:
        REPOSITORY_CREDENTIALS: ${{ secrets.REPOSITORY_CREDENTIALS }}