|
| 1 | +name: ci |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: [main] |
| 7 | + |
| 8 | +jobs: |
| 9 | + changes: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + outputs: |
| 12 | + core: ${{ steps.filter.outputs.core }} |
| 13 | + configs: ${{ steps.filter.outputs.configs }} |
| 14 | + setup: ${{ steps.filter.outputs.setup }} |
| 15 | + starter: ${{ steps.filter.outputs.starter }} |
| 16 | + docs: ${{ steps.filter.outputs.docs }} |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v4 |
| 19 | + - uses: dorny/paths-filter@v3 |
| 20 | + id: filter |
| 21 | + with: |
| 22 | + filters: | |
| 23 | + core: |
| 24 | + - 'packages/webentor-core/**' |
| 25 | + configs: |
| 26 | + - 'packages/webentor-configs/**' |
| 27 | + setup: |
| 28 | + - 'packages/webentor-setup/**' |
| 29 | + starter: |
| 30 | + - 'packages/webentor-starter/**' |
| 31 | + docs: |
| 32 | + - 'docs/**' |
| 33 | +
|
| 34 | + core: |
| 35 | + needs: [changes] |
| 36 | + if: ${{ needs.changes.outputs.core == 'true' }} |
| 37 | + runs-on: ubuntu-latest |
| 38 | + steps: |
| 39 | + - uses: actions/checkout@v4 |
| 40 | + - uses: actions/setup-node@v4 |
| 41 | + with: |
| 42 | + node-version: '20' |
| 43 | + - name: Enable corepack |
| 44 | + run: corepack enable |
| 45 | + - name: Install core deps |
| 46 | + run: pnpm install --ignore-scripts --filter './packages/webentor-core...' |
| 47 | + - name: Lint/build/test core |
| 48 | + run: | |
| 49 | + pnpm --filter './packages/webentor-core' --if-present run lint |
| 50 | + pnpm --filter './packages/webentor-core' --if-present run build |
| 51 | + pnpm --filter './packages/webentor-core' --if-present run test |
| 52 | +
|
| 53 | + configs: |
| 54 | + needs: [changes] |
| 55 | + if: ${{ needs.changes.outputs.configs == 'true' }} |
| 56 | + runs-on: ubuntu-latest |
| 57 | + steps: |
| 58 | + - uses: actions/checkout@v4 |
| 59 | + - uses: actions/setup-node@v4 |
| 60 | + with: |
| 61 | + node-version: '20' |
| 62 | + - name: Enable corepack |
| 63 | + run: corepack enable |
| 64 | + - name: Install configs deps |
| 65 | + run: pnpm install --ignore-scripts --filter './packages/webentor-configs...' |
| 66 | + - name: Lint/build/test configs |
| 67 | + run: | |
| 68 | + pnpm --filter './packages/webentor-configs' --if-present run lint |
| 69 | + pnpm --filter './packages/webentor-configs' --if-present run build |
| 70 | + pnpm --filter './packages/webentor-configs' --if-present run test |
| 71 | +
|
| 72 | + setup: |
| 73 | + needs: [changes] |
| 74 | + if: ${{ needs.changes.outputs.setup == 'true' }} |
| 75 | + runs-on: ubuntu-latest |
| 76 | + steps: |
| 77 | + - uses: actions/checkout@v4 |
| 78 | + - name: Validate shell scripts |
| 79 | + run: | |
| 80 | + find packages/webentor-setup -type f -name '*.sh' -print0 | xargs -0 -n1 bash -n |
| 81 | + - name: Validate setup CLI PHP |
| 82 | + run: | |
| 83 | + php -l packages/webentor-setup/src/webentor-setup.php |
| 84 | +
|
| 85 | + starter: |
| 86 | + needs: [changes] |
| 87 | + if: ${{ needs.changes.outputs.starter == 'true' }} |
| 88 | + runs-on: ubuntu-latest |
| 89 | + steps: |
| 90 | + - uses: actions/checkout@v4 |
| 91 | + - uses: shivammathur/setup-php@v2 |
| 92 | + with: |
| 93 | + php-version: '8.2' |
| 94 | + - uses: actions/setup-node@v4 |
| 95 | + with: |
| 96 | + node-version: '20' |
| 97 | + - name: Enable corepack |
| 98 | + run: corepack enable |
| 99 | + - name: Install starter root dependencies |
| 100 | + working-directory: packages/webentor-starter |
| 101 | + run: composer install --no-interaction --prefer-dist |
| 102 | + - name: Build starter theme |
| 103 | + working-directory: packages/webentor-starter/web/app/themes/webentor-theme-v2 |
| 104 | + run: | |
| 105 | + pnpm install --ignore-scripts |
| 106 | + pnpm build |
| 107 | +
|
| 108 | + docs: |
| 109 | + needs: [changes] |
| 110 | + if: ${{ needs.changes.outputs.docs == 'true' }} |
| 111 | + runs-on: ubuntu-latest |
| 112 | + steps: |
| 113 | + - uses: actions/checkout@v4 |
| 114 | + - uses: actions/setup-node@v4 |
| 115 | + with: |
| 116 | + node-version: '20' |
| 117 | + - name: Enable corepack |
| 118 | + run: corepack enable |
| 119 | + - name: Build docs |
| 120 | + run: | |
| 121 | + pnpm --dir docs install --ignore-scripts |
| 122 | + pnpm --dir docs docs:build |
0 commit comments