-
Notifications
You must be signed in to change notification settings - Fork 51
69 lines (62 loc) · 1.78 KB
/
pr.yml
File metadata and controls
69 lines (62 loc) · 1.78 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: CI
on:
pull_request:
branches: [master]
types: [opened, synchronize, reopened]
push:
branches: [master]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
changes:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
backend: ${{ steps.filter.outputs.backend }}
frontend: ${{ steps.filter.outputs.frontend }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
backend:
- 'montage/**'
- 'requirements.txt'
- 'requirements.in'
- 'setup.py'
- 'dockerfile'
frontend:
- 'frontend/**'
test-backend:
name: Test Backend (Python)
needs: changes
if: needs.changes.outputs.backend == 'true'
uses: ./.github/workflows/test-backend.yml
lint-frontend:
name: Lint & Build Frontend (Vue)
needs: changes
if: needs.changes.outputs.frontend == 'true'
uses: ./.github/workflows/lint-frontend.yml
ci-complete:
name: CI Complete
runs-on: ubuntu-latest
needs: [test-backend, lint-frontend]
if: always()
steps:
- name: Check job results
run: |
for job in test-backend lint-frontend; do
case "$job" in
test-backend) result="${{ needs.test-backend.result }}" ;;
lint-frontend) result="${{ needs.lint-frontend.result }}" ;;
esac
if [ "$result" != "success" ] && [ "$result" != "skipped" ]; then
echo "::error::Job $job failed with result: $result"
exit 1
fi
done
echo "All CI jobs passed or were correctly skipped."