|
35 | 35 | compose.yaml
|
36 | 36 | compose.override.yaml
|
37 | 37 | set: |
|
38 |
| - *.cache-from=type=gha,scope=${{github.ref}} |
| 38 | + *.cache-from=type=gha,scope=${{ github.ref }} |
39 | 39 | *.cache-from=type=gha,scope=refs/heads/main
|
40 |
| - *.cache-to=type=gha,scope=${{github.ref}},mode=max |
| 40 | + *.cache-to=type=gha,scope=${{ github.ref }},mode=max |
41 | 41 | -
|
42 | 42 | name: Start services
|
43 | 43 | run: docker compose up --wait --no-build
|
@@ -113,10 +113,10 @@ jobs:
|
113 | 113 | compose.yaml
|
114 | 114 | compose.prod.yaml
|
115 | 115 | set: |
|
116 |
| - *.cache-from=type=gha,scope=${{github.ref}}-e2e |
117 |
| - *.cache-from=type=gha,scope=${{github.ref}} |
| 116 | + *.cache-from=type=gha,scope=${{ github.ref }}-e2e |
| 117 | + *.cache-from=type=gha,scope=${{ github.ref }} |
118 | 118 | *.cache-from=type=gha,scope=refs/heads/main
|
119 |
| - *.cache-to=type=gha,scope=${{github.ref}}-e2e,mode=max |
| 119 | + *.cache-to=type=gha,scope=${{ github.ref }}-e2e,mode=max |
120 | 120 | -
|
121 | 121 | name: Start Services
|
122 | 122 | run: docker compose up --wait --no-build
|
@@ -176,14 +176,44 @@ jobs:
|
176 | 176 | path: pwa/test-results
|
177 | 177 |
|
178 | 178 | lint:
|
179 |
| - name: Docker Lint |
| 179 | + name: Lint |
180 | 180 | runs-on: ubuntu-latest
|
181 | 181 | steps:
|
182 | 182 | -
|
183 | 183 | name: Checkout
|
184 | 184 | uses: actions/checkout@v4
|
| 185 | + |
| 186 | + # Lint Dockerfiles |
185 | 187 | -
|
186 | 188 | name: Lint Dockerfiles
|
187 | 189 |
|
188 | 190 | with:
|
189 | 191 | recursive: true
|
| 192 | + |
| 193 | + # Lint API PHP files |
| 194 | + - |
| 195 | + name: PHP CS Fixer Cache |
| 196 | + uses: actions/cache@v3 |
| 197 | + with: |
| 198 | + path: api/.php-cs-fixer.cache |
| 199 | + key: ${{ runner.OS }}-phpcsfixer-${{ github.sha }} |
| 200 | + restore-keys: | |
| 201 | + ${{ runner.OS }}-phpcsfixer- |
| 202 | + - |
| 203 | + name: Get API changed files |
| 204 | + id: api-changed-files |
| 205 | + uses: tj-actions/changed-files@v38 |
| 206 | + - |
| 207 | + name: Get Extra Arguments for PHP-CS-Fixer |
| 208 | + id: phpcs-intersection |
| 209 | + run: | |
| 210 | + CHANGED_FILES=$(echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}" | tr ' ' '\n') |
| 211 | + if ! echo "${CHANGED_FILES}" | grep -qE "^api\/(\\.php-cs-fixer(\\.dist)?\\.php|composer\\.lock)$"; then EXTRA_ARGS=$(printf -- '--path-mode=intersection\n--\n%s' "${CHANGED_FILES}"); else EXTRA_ARGS=''; fi |
| 212 | + echo "PHPCS_EXTRA_ARGS<<EOF" >> $GITHUB_ENV |
| 213 | + echo "$EXTRA_ARGS" >> $GITHUB_ENV |
| 214 | + echo "EOF" >> $GITHUB_ENV |
| 215 | + - |
| 216 | + name: Lint API PHP Files |
| 217 | + uses: docker://oskarstark/php-cs-fixer-ga |
| 218 | + with: |
| 219 | + args: --config=api/.php-cs-fixer.dist.php -v --dry-run --stop-on-violation --using-cache=no ${{ env.PHPCS_EXTRA_ARGS }}" |
0 commit comments