-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 loc) · 1.69 KB
/
code-checks.yml
File metadata and controls
50 lines (42 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Code Checks
on:
pull_request:
types: [opened, synchronize, ready_for_review]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
phpcs:
if: github.event.pull_request.draft == false
uses: macrosbysara/shared-github-actions/.github/workflows/phpcs.yml@main
lint-style:
if: github.event.pull_request.draft == false
uses: macrosbysara/shared-github-actions/.github/workflows/lint-if-changed.yml@main
with:
file_extensions: '\.(scss|css)$'
lint_command: bun run lint:css
lint-js:
if: github.event.pull_request.draft == false
uses: macrosbysara/shared-github-actions/.github/workflows/lint-if-changed.yml@main
with:
file_extensions: '\.(js|jsx|ts|tsx)$'
lint_command: bun run lint:js
final-check:
needs: [phpcs, lint-style, lint-js]
runs-on: ubuntu-latest
if: always() && github.event.pull_request.draft == false
steps:
- name: Verify all checks passed
run: |
results="${{ needs.phpcs.result }} ${{ needs.lint-style.result }} ${{ needs.lint-js.result }}"
echo "Job results: $results"
if [[ "$results" =~ failure ]]; then
echo "❌ One or more checks failed."
exit 1
fi
if [[ "$results" =~ cancelled ]]; then
echo "⚠️ One or more checks were cancelled."
exit 1
fi
echo "✅ All checks passed or were skipped."