Skip to content

Commit dd9e637

Browse files
committed
ci: skip unrelated runtime checks
1 parent 6befaf0 commit dd9e637

4 files changed

Lines changed: 84 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
env:
1010
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
1111

12+
permissions:
13+
contents: read
14+
pull-requests: read
15+
1216
jobs:
1317
unit-tests:
1418
runs-on: ubuntu-latest
@@ -32,18 +36,45 @@ jobs:
3236
fetch-depth: 0
3337
fetch-tags: true
3438

39+
- name: Check changed files
40+
id: changes
41+
uses: dorny/paths-filter@v4
42+
with:
43+
filters: |
44+
backend_unit:
45+
- 'apps/backend/**'
46+
- 'packages/**'
47+
- 'lib/**'
48+
- 'openapi/**'
49+
- '.github/workflows/ci.yml'
50+
- 'go.mod'
51+
- 'go.sum'
52+
- 'package.json'
53+
- 'pnpm-lock.yaml'
54+
- 'pnpm-workspace.yaml'
55+
- '.env.example'
56+
- '.air.toml'
57+
3558
- uses: pnpm/action-setup@v6
59+
if: steps.changes.outputs.backend_unit == 'true'
3660

3761
- uses: actions/setup-node@v6
62+
if: steps.changes.outputs.backend_unit == 'true'
3863
with:
3964
node-version: 24
4065
cache: "pnpm"
4166

4267
- name: Install dependencies
68+
if: steps.changes.outputs.backend_unit == 'true'
4369
run: pnpm install
4470

4571
- name: Run backend unit tests
72+
if: steps.changes.outputs.backend_unit == 'true'
4673
env:
4774
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable
4875
run: |
4976
go test ./apps/backend/internal/billing/... ./apps/backend/internal/catalog/... ./apps/backend/internal/governance/... ./apps/backend/internal/http/... ./apps/backend/internal/identity/... ./apps/backend/internal/importing/... ./apps/backend/internal/membership/... ./apps/backend/internal/platform/... ./apps/backend/internal/tenant/... ./apps/backend/internal/tracking/... ./apps/backend/internal/web/...
77+
78+
- name: Skip backend unit tests
79+
if: steps.changes.outputs.backend_unit != 'true'
80+
run: echo "Skipping backend unit tests because this change does not touch backend, shared runtime, OpenAPI, dependency, or CI files."

.github/workflows/cli-integration.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
env:
1010
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
1111

12+
permissions:
13+
contents: read
14+
pull-requests: read
15+
1216
jobs:
1317
cli-integration:
1418
runs-on: ubuntu-latest
@@ -38,24 +42,51 @@ jobs:
3842
steps:
3943
- uses: actions/checkout@v6
4044
with:
45+
fetch-depth: 0
4146
submodules: true
4247

48+
- name: Check changed files
49+
id: changes
50+
uses: dorny/paths-filter@v4
51+
with:
52+
filters: |
53+
cli_integration:
54+
- 'apps/backend/**'
55+
- 'packages/**'
56+
- 'lib/**'
57+
- 'openapi/**'
58+
- 'tests/cli-integration/**'
59+
- 'tests/python-sdk-integration/**'
60+
- '.github/workflows/cli-integration.yml'
61+
- 'go.mod'
62+
- 'go.sum'
63+
- 'package.json'
64+
- 'pnpm-lock.yaml'
65+
- 'pnpm-workspace.yaml'
66+
- '.env.example'
67+
- '.air.toml'
68+
4369
- uses: pnpm/action-setup@v6
70+
if: steps.changes.outputs.cli_integration == 'true'
4471

4572
- uses: actions/setup-node@v6
73+
if: steps.changes.outputs.cli_integration == 'true'
4674
with:
4775
node-version: 24
4876
cache: "pnpm"
4977

5078
- name: Install dependencies
79+
if: steps.changes.outputs.cli_integration == 'true'
5180
run: pnpm install
5281

5382
- name: Build backend
83+
if: steps.changes.outputs.cli_integration == 'true'
5484
env:
5585
CGO_ENABLED: 0
5686
run: go build -o /tmp/opentoggl ./apps/backend
5787

5888
- name: Start backend
89+
if: steps.changes.outputs.cli_integration == 'true'
5990
env:
6091
OPENTOGGL_SERVICE_NAME: opentoggl-api
6192
PORT: 8080
@@ -75,28 +106,37 @@ jobs:
75106
done
76107
77108
- name: Install toggl CLI
109+
if: steps.changes.outputs.cli_integration == 'true'
78110
run: |
79111
npm install -g @correctroadh/toggl-cli
80112
toggl --help >/dev/null
81113
82114
- name: Run CLI integration tests
115+
if: steps.changes.outputs.cli_integration == 'true'
83116
env:
84117
OPENTOGGL_CLI_TEST_URL: http://127.0.0.1:8080/api/v9
85118
OPENTOGGL_CLI_TEST_BASE: http://127.0.0.1:8080
86119
run: pnpm run test:cli
87120

88121
- name: Setup Python
122+
if: steps.changes.outputs.cli_integration == 'true'
89123
uses: actions/setup-python@v6
90124
with:
91125
python-version: "3.12"
92126

93127
- name: Install Python SDK test dependencies
128+
if: steps.changes.outputs.cli_integration == 'true'
94129
working-directory: tests/python-sdk-integration/toggl-cli
95130
run: pip install -r requirements.txt -r test-requirements.txt
96131

97132
- name: Run Python SDK integration tests
133+
if: steps.changes.outputs.cli_integration == 'true'
98134
working-directory: tests/python-sdk-integration
99135
env:
100136
OPENTOGGL_CLI_TEST_URL: http://127.0.0.1:8080/api/v9
101137
OPENTOGGL_CLI_TEST_BASE: http://127.0.0.1:8080
102138
run: python -m pytest -x -v
139+
140+
- name: Skip CLI integration tests
141+
if: steps.changes.outputs.cli_integration != 'true'
142+
run: echo "Skipping CLI integration tests because this change does not touch backend, CLI tests, shared runtime, OpenAPI, dependency, or CI files."

.github/workflows/e2e.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
uses: dorny/paths-filter@v4
5151
with:
5252
filters: |
53-
website-e2e:
53+
website_e2e:
5454
- 'apps/website/**'
5555
- 'apps/backend/**'
5656
- 'packages/**'
@@ -69,34 +69,34 @@ jobs:
6969
- '.air.toml'
7070
7171
- uses: pnpm/action-setup@v6
72-
if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.website-e2e == 'true'
72+
if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.website_e2e == 'true'
7373

7474
- uses: actions/setup-node@v6
75-
if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.website-e2e == 'true'
75+
if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.website_e2e == 'true'
7676
with:
7777
node-version: 24
7878
cache: "pnpm"
7979

8080
- name: Install dependencies
81-
if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.website-e2e == 'true'
81+
if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.website_e2e == 'true'
8282
run: pnpm install
8383

8484
- name: Build backend
85-
if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.website-e2e == 'true'
85+
if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.website_e2e == 'true'
8686
env:
8787
CGO_ENABLED: 0
8888
run: go build -o /tmp/opentoggl ./apps/backend
8989

9090
- name: Build frontend
91-
if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.website-e2e == 'true'
91+
if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.website_e2e == 'true'
9292
run: pnpm --filter @opentickly/website run build
9393

9494
- name: Install Playwright browsers
95-
if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.website-e2e == 'true'
95+
if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.website_e2e == 'true'
9696
run: pnpm exec playwright install --with-deps chromium webkit
9797

9898
- name: Start backend
99-
if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.website-e2e == 'true'
99+
if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.website_e2e == 'true'
100100
env:
101101
OPENTOGGL_SERVICE_NAME: opentoggl-api
102102
PORT: 8080
@@ -109,7 +109,7 @@ jobs:
109109
sleep 5
110110
111111
- name: Wait for backend to be ready
112-
if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.website-e2e == 'true'
112+
if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.website_e2e == 'true'
113113
run: |
114114
for i in {1..30}; do
115115
if curl -sf http://localhost:8080/readyz > /dev/null 2>&1; then
@@ -123,19 +123,19 @@ jobs:
123123
exit 1
124124
125125
- name: Start frontend dev server
126-
if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.website-e2e == 'true'
126+
if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.website_e2e == 'true'
127127
env:
128128
OPENTOGGL_WEB_PROXY_TARGET: http://127.0.0.1:8080
129129
run: |
130130
pnpm exec vp run website#dev -- --port 5173 &
131131
sleep 5
132132
133133
- name: Run E2E tests
134-
if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.website-e2e == 'true'
134+
if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.website_e2e == 'true'
135135
run: |
136136
cd apps/website
137137
pnpm exec playwright test
138138
139139
- name: Skip E2E tests
140-
if: github.event_name != 'workflow_dispatch' && steps.changes.outputs.website-e2e != 'true'
140+
if: github.event_name != 'workflow_dispatch' && steps.changes.outputs.website_e2e != 'true'
141141
run: echo "Skipping website E2E because this change does not touch website, backend, shared runtime, OpenAPI, dependency, or E2E workflow files."

.github/workflows/update-worker-deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
branches: [main]
1111
paths:
1212
- "apps/update-worker/**"
13+
- "!apps/update-worker/README.md"
1314
- ".github/workflows/update-worker-deploy.yml"
1415
workflow_dispatch:
1516

0 commit comments

Comments
 (0)