Skip to content

Commit 33d2e9b

Browse files
authored
ci: split inspect and sync lanes in depot ci (#17)
* ci: split inspect and sync lanes in depot ci * fix: run sync lane on core changes
1 parent 4a63407 commit 33d2e9b

2 files changed

Lines changed: 87 additions & 7 deletions

File tree

.depot/workflows/ci.yml

Lines changed: 80 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,44 @@ on:
1313
permissions:
1414
contents: read
1515
jobs:
16+
changes:
17+
name: Changed Paths
18+
runs-on: depot-ubuntu-24.04
19+
outputs:
20+
inspect: ${{ steps.scope.outputs.inspect }}
21+
sync: ${{ steps.scope.outputs.sync }}
22+
steps:
23+
- uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
- name: Classify changed paths
27+
id: scope
28+
shell: bash
29+
run: |
30+
if [[ "${{ github.event_name }}" != "pull_request" ]]; then
31+
echo "inspect=true" >> "$GITHUB_OUTPUT"
32+
echo "sync=true" >> "$GITHUB_OUTPUT"
33+
exit 0
34+
fi
35+
36+
inspect=false
37+
sync=false
38+
while IFS= read -r path; do
39+
case "$path" in
40+
apps/convex-inspect/*|crates/convex-sync-core/*|Cargo.toml|Cargo.lock|rust-toolchain.toml|rustfmt.toml|.depot/workflows/ci.yml)
41+
inspect=true
42+
;;
43+
esac
44+
case "$path" in
45+
apps/convex-sync/*|crates/convex-export-s3/*|crates/convex-sync-core/*|Cargo.toml|Cargo.lock|rust-toolchain.toml|rustfmt.toml|.depot/workflows/ci.yml)
46+
sync=true
47+
;;
48+
esac
49+
done < <(git diff --name-only "${{ github.event.pull_request.base.sha }}"...HEAD)
50+
51+
echo "inspect=${inspect}" >> "$GITHUB_OUTPUT"
52+
echo "sync=${sync}" >> "$GITHUB_OUTPUT"
53+
1654
fmt:
1755
name: Rustfmt
1856
runs-on: depot-ubuntu-24.04 # was: ubuntu-24.04. Mapped standard GitHub runner to Depot equivalent.
@@ -24,8 +62,42 @@ jobs:
2462
components: rustfmt
2563
- name: Run rustfmt
2664
run: cargo fmt --all --check
27-
clippy:
28-
name: Clippy
65+
clippy-inspect:
66+
name: Clippy / Inspect
67+
needs: changes
68+
if: needs.changes.outputs.inspect == 'true'
69+
runs-on: depot-ubuntu-24.04
70+
steps:
71+
- uses: actions/checkout@v4
72+
- name: Setup Depot
73+
uses: depot/setup-action@v1
74+
- name: Install sccache
75+
run: sudo apt-get update && sudo apt-get install -y sccache
76+
- name: Install Rust toolchain
77+
uses: dtolnay/rust-toolchain@stable
78+
with:
79+
components: clippy
80+
- name: Run clippy
81+
run: depot cargo clippy -p convex-sync-core -p convex-inspect --all-targets --all-features -- -D warnings
82+
test-inspect:
83+
name: Test / Inspect
84+
needs: changes
85+
if: needs.changes.outputs.inspect == 'true'
86+
runs-on: depot-ubuntu-24.04
87+
steps:
88+
- uses: actions/checkout@v4
89+
- name: Setup Depot
90+
uses: depot/setup-action@v1
91+
- name: Install sccache
92+
run: sudo apt-get update && sudo apt-get install -y sccache
93+
- name: Install Rust toolchain
94+
uses: dtolnay/rust-toolchain@stable
95+
- name: Run tests
96+
run: depot cargo test -p convex-sync-core -p convex-inspect
97+
clippy-sync:
98+
name: Clippy / Sync
99+
needs: changes
100+
if: needs.changes.outputs.sync == 'true'
29101
runs-on: depot-ubuntu-latest-4
30102
steps:
31103
- uses: actions/checkout@v4
@@ -38,9 +110,11 @@ jobs:
38110
with:
39111
components: clippy
40112
- name: Run clippy
41-
run: depot cargo clippy --workspace --all-targets --all-features -- -D warnings
42-
test:
43-
name: Test
113+
run: depot cargo clippy -p convex-export-s3 -p convex-sync --all-targets --all-features -- -D warnings
114+
test-sync:
115+
name: Test / Sync
116+
needs: changes
117+
if: needs.changes.outputs.sync == 'true'
44118
runs-on: depot-ubuntu-latest-4
45119
steps:
46120
- uses: actions/checkout@v4
@@ -51,4 +125,4 @@ jobs:
51125
- name: Install Rust toolchain
52126
uses: dtolnay/rust-toolchain@stable
53127
- name: Run tests
54-
run: depot cargo test --workspace
128+
run: depot cargo test -p convex-export-s3 -p convex-sync

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,13 @@ Local:
172172

173173
Remote:
174174

175-
- `.depot/workflows/ci.yml` runs fmt/clippy/test
175+
- `.depot/workflows/ci.yml` runs:
176+
- `Rustfmt`
177+
- `Changed Paths`
178+
- `Clippy / Inspect`
179+
- `Test / Inspect`
180+
- `Clippy / Sync`
181+
- `Test / Sync`
176182
- `.depot/workflows/release.yml` creates stable release PRs and publishes CLI archives
177183
- `.depot/workflows/release-rc.yml` publishes numbered prerelease archives from `main`
178184
- `.github/workflows/semantic-pr.yml` enforces conventional PR titles so stable releases can be created automatically from merged PRs

0 commit comments

Comments
 (0)