Skip to content

Commit 4a3c172

Browse files
feat(repo): add diff checks in CI flows (#7657)
1 parent 5d1ad8a commit 4a3c172

3 files changed

Lines changed: 55 additions & 35 deletions

File tree

.github/workflows/build-branch.yml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ on:
3535
- preview
3636
- canary
3737

38+
concurrency:
39+
group: ${{ github.workflow }}-${{ github.ref }}
40+
cancel-in-progress: true
41+
3842
env:
3943
TARGET_BRANCH: ${{ github.ref_name }}
4044
ARM64_BUILD: ${{ github.event.inputs.arm64 }}
@@ -268,15 +272,14 @@ jobs:
268272
if: ${{ needs.branch_build_setup.outputs.aio_build == 'true' }}
269273
name: Build-Push AIO Docker Image
270274
runs-on: ubuntu-22.04
271-
needs: [
272-
branch_build_setup,
273-
branch_build_push_admin,
274-
branch_build_push_web,
275-
branch_build_push_space,
276-
branch_build_push_live,
277-
branch_build_push_api,
278-
branch_build_push_proxy
279-
]
275+
needs:
276+
- branch_build_setup
277+
- branch_build_push_admin
278+
- branch_build_push_web
279+
- branch_build_push_space
280+
- branch_build_push_live
281+
- branch_build_push_api
282+
- branch_build_push_proxy
280283
steps:
281284
- name: Checkout Files
282285
uses: actions/checkout@v4
@@ -285,7 +288,7 @@ jobs:
285288
id: prepare_aio_assets
286289
run: |
287290
cd deployments/aio/community
288-
291+
289292
if [ "${{ needs.branch_build_setup.outputs.build_type }}" == "Release" ]; then
290293
aio_version=${{ needs.branch_build_setup.outputs.release_version }}
291294
else
@@ -324,7 +327,14 @@ jobs:
324327
upload_build_assets:
325328
name: Upload Build Assets
326329
runs-on: ubuntu-22.04
327-
needs: [branch_build_setup, branch_build_push_admin, branch_build_push_web, branch_build_push_space, branch_build_push_live, branch_build_push_api, branch_build_push_proxy]
330+
needs:
331+
- branch_build_setup
332+
- branch_build_push_admin
333+
- branch_build_push_web
334+
- branch_build_push_space
335+
- branch_build_push_live
336+
- branch_build_push_api
337+
- branch_build_push_proxy
328338
steps:
329339
- name: Checkout Files
330340
uses: actions/checkout@v4
@@ -397,4 +407,3 @@ jobs:
397407
${{ github.workspace }}/deployments/cli/community/docker-compose.yml
398408
${{ github.workspace }}/deployments/cli/community/variables.env
399409
${{ github.workspace }}/deployments/swarm/community/swarm.sh
400-

.github/workflows/pull-request-build-lint-api.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,21 @@ name: Build and lint API
33
on:
44
workflow_dispatch:
55
pull_request:
6-
branches: ["preview"]
7-
types: ["opened", "synchronize", "ready_for_review", "review_requested", "reopened"]
6+
branches:
7+
- "preview"
8+
types:
9+
- "opened"
10+
- "synchronize"
11+
- "ready_for_review"
12+
- "review_requested"
13+
- "reopened"
814
paths:
915
- "apps/api/**"
1016

17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
1121
jobs:
1222
lint-api:
1323
name: Lint API

.github/workflows/pull-request-build-lint-web-apps.yml

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,18 @@ name: Build and lint web apps
33
on:
44
workflow_dispatch:
55
pull_request:
6-
branches: ["preview"]
6+
branches:
7+
- "preview"
78
types:
8-
[
9-
"opened",
10-
"synchronize",
11-
"ready_for_review",
12-
"review_requested",
13-
"reopened",
14-
]
15-
paths:
16-
- "**.tsx?"
17-
- "**.jsx?"
18-
- "**.css"
19-
- "**.json"
20-
- "!apps/api/**"
9+
- "opened"
10+
- "synchronize"
11+
- "ready_for_review"
12+
- "review_requested"
13+
- "reopened"
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
2118

2219
jobs:
2320
build-and-lint:
@@ -27,11 +24,15 @@ jobs:
2724
if: |
2825
github.event.pull_request.draft == false &&
2926
github.event.pull_request.requested_reviewers != null
27+
env:
28+
TURBO_SCM_BASE: ${{ github.event.pull_request.base.sha }}
29+
TURBO_SCM_HEAD: ${{ github.sha }}
3030
steps:
3131
- name: Checkout code
3232
uses: actions/checkout@v4
3333
with:
34-
fetch-depth: 2
34+
fetch-depth: 50
35+
filter: blob:none
3536

3637
- name: Set up Node.js
3738
uses: actions/setup-node@v4
@@ -44,11 +45,11 @@ jobs:
4445
- name: Install dependencies
4546
run: pnpm install --frozen-lockfile
4647

47-
- name: Lint web apps
48-
run: pnpm run check:lint
48+
- name: Lint Affected
49+
run: pnpm turbo run check:lint --affected
4950

50-
- name: Check format
51-
run: pnpm run check:format
51+
- name: Check Affected format
52+
run: pnpm turbo run check:format --affected
5253

53-
- name: Build apps
54-
run: pnpm run build
54+
- name: Build Affected
55+
run: pnpm turbo run build --affected

0 commit comments

Comments
 (0)