Skip to content

Commit d8330d7

Browse files
M8F-66: [Feature] Added tests to CI workflow and Updated PR notification
1 parent 7fc7af0 commit d8330d7

File tree

2 files changed

+42
-15
lines changed

2 files changed

+42
-15
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ permissions:
1515

1616
jobs:
1717
changes:
18-
if: vars.AUTO_BUILD == 'true' || github.event_name == 'workflow_dispatch'
1918
runs-on: ubuntu-latest
2019
outputs:
2120
backend: ${{ steps.filter.outputs.backend }}
2221
frontend: ${{ steps.filter.outputs.frontend }}
23-
extensions: ${{ steps.filter.outputs.extensions }}
22+
extensions_backend: ${{ steps.filter.outputs.extensions_backend }}
23+
extensions_frontend: ${{ steps.filter.outputs.extensions_frontend }}
2424
migrations: ${{ steps.filter.outputs.migrations }}
2525
docker_m8flow: ${{ steps.filter.outputs.docker_m8flow }}
2626
steps:
@@ -33,9 +33,11 @@ jobs:
3333
- 'spiffworkflow-backend/**'
3434
frontend:
3535
- 'spiffworkflow-frontend/**'
36-
extensions:
36+
extensions_backend:
3737
- 'extensions/m8flow-backend/**'
3838
- 'spiffworkflow-backend/**'
39+
extensions_frontend:
40+
- 'extensions/frontend/**'
3941
migrations:
4042
- 'spiffworkflow-backend/migrations/versions/*.py'
4143
docker_m8flow:
@@ -47,7 +49,7 @@ jobs:
4749
# -------------------------
4850
backend:
4951
needs: changes
50-
if: ${{ (vars.AUTO_BUILD == 'true' || github.event_name == 'workflow_dispatch') && needs.changes.outputs.backend == 'true' }}
52+
if: ${{ needs.changes.outputs.backend == 'true' }}
5153
runs-on: ubuntu-latest
5254
defaults:
5355
run:
@@ -56,7 +58,7 @@ jobs:
5658
- uses: actions/checkout@v4
5759
- uses: actions/setup-python@v5
5860
with:
59-
python-version: '3.10'
61+
python-version: '3.11'
6062
- name: Install uv
6163
run: pip install uv
6264
- name: Install dependencies
@@ -73,7 +75,7 @@ jobs:
7375
# -------------------------
7476
frontend:
7577
needs: changes
76-
if: ${{ (vars.AUTO_BUILD == 'true' || github.event_name == 'workflow_dispatch') && needs.changes.outputs.frontend == 'true' }}
78+
if: ${{ needs.changes.outputs.frontend == 'true' }}
7779
runs-on: ubuntu-latest
7880
defaults:
7981
run:
@@ -93,11 +95,11 @@ jobs:
9395
run: npm test
9496

9597
# -------------------------
96-
# Extensions CI
98+
# Extensions Backend CI
9799
# -------------------------
98-
extensions:
100+
extensions-backend:
99101
needs: changes
100-
if: ${{ (vars.AUTO_BUILD == 'true' || github.event_name == 'workflow_dispatch') && needs.changes.outputs.extensions == 'true' }}
102+
if: ${{ needs.changes.outputs.extensions_backend == 'true' }}
101103
runs-on: ubuntu-latest
102104
defaults:
103105
run:
@@ -106,7 +108,7 @@ jobs:
106108
- uses: actions/checkout@v4
107109
- uses: actions/setup-python@v5
108110
with:
109-
python-version: '3.10'
111+
python-version: '3.11'
110112
- name: Install uv
111113
run: pip install uv
112114
- name: Install dependencies
@@ -116,13 +118,37 @@ jobs:
116118
export PYTHONPATH=$PYTHONPATH:$(pwd):$(pwd)/src:$(pwd)/../extensions/m8flow-backend/src
117119
uv run pytest ../extensions/m8flow-backend/tests
118120
121+
# -------------------------
122+
# Extensions Frontend CI
123+
# -------------------------
124+
extensions-frontend:
125+
needs: changes
126+
if: ${{ needs.changes.outputs.extensions_frontend == 'true' }}
127+
runs-on: ubuntu-latest
128+
defaults:
129+
run:
130+
working-directory: extensions/frontend
131+
steps:
132+
- uses: actions/checkout@v4
133+
- uses: actions/setup-node@v4
134+
with:
135+
node-version: '20'
136+
cache: 'npm'
137+
cache-dependency-path: extensions/frontend/package-lock.json
138+
- name: Install dependencies
139+
run: npm ci
140+
- name: Typecheck
141+
run: npm run typecheck
142+
- name: Test
143+
run: npm test
144+
119145
# -------------------------
120146
# Security: CodeQL
121147
# -------------------------
122148
codeql:
123149
name: CodeQL Scan
124150
runs-on: ubuntu-latest
125-
if: ${{ (vars.AUTO_BUILD == 'true' || github.event_name == 'workflow_dispatch') && github.event_name == 'pull_request' }}
151+
if: ${{ github.event_name == 'pull_request' }}
126152
strategy:
127153
matrix:
128154
language: [ 'python', 'javascript' ]
@@ -141,7 +167,7 @@ jobs:
141167
trivy:
142168
name: Trivy Security Scan
143169
runs-on: ubuntu-latest
144-
if: ${{ (vars.AUTO_BUILD == 'true' || github.event_name == 'workflow_dispatch') && github.event_name == 'pull_request' }}
170+
if: ${{ github.event_name == 'pull_request' }}
145171
steps:
146172
- uses: actions/checkout@v4
147173
- uses: aquasecurity/trivy-action@0.20.0
@@ -158,7 +184,7 @@ jobs:
158184
migration-check:
159185
name: Migration Compatibility Check
160186
needs: changes
161-
if: ${{ (vars.AUTO_BUILD == 'true' || github.event_name == 'workflow_dispatch') && needs.changes.outputs.migrations == 'true' && github.event_name == 'pull_request' }}
187+
if: ${{ needs.changes.outputs.migrations == 'true' && github.event_name == 'pull_request' }}
162188
uses: ./.github/workflows/check-migrations.yml
163189
with:
164190
migrations_changed: true
@@ -170,7 +196,7 @@ jobs:
170196
name: Docker Build Dry Run
171197
needs: changes
172198
runs-on: ubuntu-latest
173-
if: ${{ (vars.AUTO_BUILD == 'true' || github.event_name == 'workflow_dispatch') && (needs.changes.outputs.backend == 'true' || needs.changes.outputs.frontend == 'true' || needs.changes.outputs.extensions == 'true' || needs.changes.outputs.docker_m8flow == 'true') && github.event_name == 'pull_request' }}
199+
if: ${{ (needs.changes.outputs.backend == 'true' || needs.changes.outputs.frontend == 'true' || needs.changes.outputs.extensions_backend == 'true' || needs.changes.outputs.docker_m8flow == 'true') && github.event_name == 'pull_request' }}
174200
steps:
175201
- uses: actions/checkout@v4
176202
- uses: docker/setup-buildx-action@v3

.github/workflows/pr-notification.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
name: Notify Google Chat on New Issue
22

33
on:
4-
pull_request:
4+
pull_request_target:
55
branches: [ main ]
66
types: [ opened ]
77

88
jobs:
99
send-alert:
1010
runs-on: ubuntu-latest
11+
if: github.event.pull_request.draft == false
1112
steps:
1213
- name: Send message to Google Chat
1314
env:

0 commit comments

Comments
 (0)