Skip to content

Commit faf7b33

Browse files
committed
add ci optimization
1 parent 91243f9 commit faf7b33

File tree

9 files changed

+126
-2
lines changed

9 files changed

+126
-2
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Graphite CI Optimizer
2+
description: Check if CI should be skipped for stacked PRs
3+
4+
inputs:
5+
graphite_token:
6+
description: Graphite API token
7+
required: true
8+
9+
outputs:
10+
skip:
11+
description: Whether to skip CI
12+
value: ${{ steps.check_skip.outputs.skip }}
13+
14+
runs:
15+
using: composite
16+
steps:
17+
- id: check_skip
18+
uses: withgraphite/graphite-ci-action@main
19+
with:
20+
graphite_token: ${{ inputs.graphite_token }}

.github/workflows/ai_ci.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,20 @@ on:
1515
- crates/llm-proxy/**
1616
- crates/transcribe-proxy/**
1717
jobs:
18+
optimize_ci:
19+
runs-on: ubuntu-latest
20+
outputs:
21+
skip: ${{ steps.check_skip.outputs.skip }}
22+
steps:
23+
- uses: actions/checkout@v4
24+
- id: check_skip
25+
uses: ./.github/actions/graphite_optimizer
26+
with:
27+
graphite_token: ${{ secrets.GRAPHITE_TOKEN }}
28+
1829
ci:
30+
needs: optimize_ci
31+
if: needs.optimize_ci.outputs.skip == 'false'
1932
runs-on: ubuntu-latest
2033
steps:
2134
- uses: actions/checkout@v4

.github/workflows/api_ci.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,20 @@ on:
1111
paths:
1212
- apps/api/**
1313
jobs:
14+
optimize_ci:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
skip: ${{ steps.check_skip.outputs.skip }}
18+
steps:
19+
- uses: actions/checkout@v4
20+
- id: check_skip
21+
uses: ./.github/actions/graphite_optimizer
22+
with:
23+
graphite_token: ${{ secrets.GRAPHITE_TOKEN }}
24+
1425
ci:
26+
needs: optimize_ci
27+
if: needs.optimize_ci.outputs.skip == 'false'
1528
runs-on: ubuntu-latest
1629
steps:
1730
- uses: actions/checkout@v4

.github/workflows/bot_ci.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,20 @@ on:
66
paths:
77
- apps/bot/**
88
jobs:
9+
optimize_ci:
10+
runs-on: ubuntu-latest
11+
outputs:
12+
skip: ${{ steps.check_skip.outputs.skip }}
13+
steps:
14+
- uses: actions/checkout@v4
15+
- id: check_skip
16+
uses: ./.github/actions/graphite_optimizer
17+
with:
18+
graphite_token: ${{ secrets.GRAPHITE_TOKEN }}
19+
920
ci:
21+
needs: optimize_ci
22+
if: needs.optimize_ci.outputs.skip == 'false'
1023
runs-on: depot-ubuntu-24.04-8
1124
steps:
1225
- uses: actions/checkout@v4

.github/workflows/db_ci.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,20 @@ on:
1313
- supabase/**
1414

1515
jobs:
16+
optimize_ci:
17+
runs-on: ubuntu-latest
18+
outputs:
19+
skip: ${{ steps.check_skip.outputs.skip }}
20+
steps:
21+
- uses: actions/checkout@v4
22+
- id: check_skip
23+
uses: ./.github/actions/graphite_optimizer
24+
with:
25+
graphite_token: ${{ secrets.GRAPHITE_TOKEN }}
26+
1627
tests:
28+
needs: optimize_ci
29+
if: needs.optimize_ci.outputs.skip == 'false'
1730
runs-on: ubuntu-latest
1831
timeout-minutes: 20
1932
steps:

.github/workflows/desktop_ci.yaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,20 @@ on:
2020
- Cargo.toml
2121
- Cargo.lock
2222
jobs:
23+
optimize_ci:
24+
runs-on: ubuntu-latest
25+
outputs:
26+
skip: ${{ steps.check_skip.outputs.skip }}
27+
steps:
28+
- uses: actions/checkout@v4
29+
- id: check_skip
30+
uses: ./.github/actions/graphite_optimizer
31+
with:
32+
graphite_token: ${{ secrets.GRAPHITE_TOKEN }}
33+
2334
desktop_ci:
35+
needs: optimize_ci
36+
if: needs.optimize_ci.outputs.skip == 'false'
2437
strategy:
2538
fail-fast: false
2639
matrix:
@@ -50,8 +63,8 @@ jobs:
5063

5164
ci:
5265
if: always()
53-
needs: [desktop_ci]
66+
needs: [optimize_ci, desktop_ci]
5467
runs-on: ubuntu-latest
5568
steps:
5669
- run: exit 1
57-
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
70+
if: needs.optimize_ci.outputs.skip == 'false' && (contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled'))

.github/workflows/eval_ci.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,20 @@ on:
1616
- go.sum
1717

1818
jobs:
19+
optimize_ci:
20+
runs-on: ubuntu-latest
21+
outputs:
22+
skip: ${{ steps.check_skip.outputs.skip }}
23+
steps:
24+
- uses: actions/checkout@v4
25+
- id: check_skip
26+
uses: ./.github/actions/graphite_optimizer
27+
with:
28+
graphite_token: ${{ secrets.GRAPHITE_TOKEN }}
29+
1930
ci:
31+
needs: optimize_ci
32+
if: needs.optimize_ci.outputs.skip == 'false'
2033
runs-on: ubuntu-latest
2134
steps:
2235
- uses: actions/checkout@v4

.github/workflows/fmt.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,20 @@ on:
99
branches:
1010
- main
1111
jobs:
12+
optimize_ci:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
skip: ${{ steps.check_skip.outputs.skip }}
16+
steps:
17+
- uses: actions/checkout@v4
18+
- id: check_skip
19+
uses: ./.github/actions/graphite_optimizer
20+
with:
21+
graphite_token: ${{ secrets.GRAPHITE_TOKEN }}
22+
1223
fmt:
24+
needs: optimize_ci
25+
if: needs.optimize_ci.outputs.skip == 'false'
1326
runs-on: depot-ubuntu-24.04-4
1427
steps:
1528
- uses: actions/checkout@v4

.github/workflows/web_ci.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,20 @@ on:
1616
- apps/web/**
1717
- packages/**
1818
jobs:
19+
optimize_ci:
20+
runs-on: ubuntu-latest
21+
outputs:
22+
skip: ${{ steps.check_skip.outputs.skip }}
23+
steps:
24+
- uses: actions/checkout@v4
25+
- id: check_skip
26+
uses: ./.github/actions/graphite_optimizer
27+
with:
28+
graphite_token: ${{ secrets.GRAPHITE_TOKEN }}
29+
1930
ci:
31+
needs: optimize_ci
32+
if: needs.optimize_ci.outputs.skip == 'false'
2033
runs-on: depot-ubuntu-24.04-4
2134
steps:
2235
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)