Skip to content

Commit 6ed8d5b

Browse files
committed
ci: run leak-check parallel to build, gate releases, move docs to release trigger
- Build and leak-check now run in parallel after lint - Release jobs now depend on both build and leak-check - Docs deployment moved to separate workflow triggered on release publish
1 parent f9a09a1 commit 6ed8d5b

2 files changed

Lines changed: 52 additions & 36 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ jobs:
6060
features: "async,macos_26_0"
6161
runs-on: ${{ matrix.os }}
6262
name: Build - ${{ matrix.name }}
63+
needs: [lint]
6364
steps:
6465
- uses: actions/checkout@v4
6566
- name: Setup Rust
@@ -84,7 +85,7 @@ jobs:
8485
run: cargo test --verbose --features "${{ matrix.features }}"
8586

8687
# ==========================================================================
87-
# Memory Leak Check
88+
# Memory Leak Check (runs parallel to build)
8889
# ==========================================================================
8990
leak-check:
9091
runs-on: macos-14
@@ -110,43 +111,11 @@ jobs:
110111
run: cargo run --example 15_memory_leak_check --features "async,macos_14_4"
111112

112113
# ==========================================================================
113-
# Documentation (only on main)
114-
# ==========================================================================
115-
docs:
116-
runs-on: macos-latest
117-
needs: [lint, build, leak-check]
118-
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
119-
permissions:
120-
contents: read
121-
pages: write
122-
id-token: write
123-
environment:
124-
name: github-pages
125-
url: ${{ steps.deployment.outputs.page_url }}
126-
steps:
127-
- uses: actions/checkout@v4
128-
- name: Setup Rust
129-
uses: dtolnay/rust-toolchain@stable
130-
- name: Build documentation
131-
run: cargo doc --no-deps --all-features
132-
- name: Add redirect
133-
run: echo '<meta http-equiv="refresh" content="0; url=screencapturekit/index.html">' > target/doc/index.html
134-
- name: Setup Pages
135-
uses: actions/configure-pages@v4
136-
- name: Upload artifact
137-
uses: actions/upload-pages-artifact@v3
138-
with:
139-
path: target/doc
140-
- name: Deploy to GitHub Pages
141-
id: deployment
142-
uses: actions/deploy-pages@v4
143-
144-
# ==========================================================================
145-
# Release (only on main, after successful build)
114+
# Release (only on main, after successful build and leak-check)
146115
# ==========================================================================
147116
release-pr:
148117
runs-on: macos-latest
149-
needs: [lint, build]
118+
needs: [lint, build, leak-check]
150119
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
151120
environment: release
152121
concurrency:
@@ -171,7 +140,7 @@ jobs:
171140

172141
release:
173142
runs-on: macos-latest
174-
needs: [lint, build]
143+
needs: [lint, build, leak-check]
175144
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
176145
environment: release
177146
permissions:

.github/workflows/docs.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Documentation
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
jobs:
12+
docs:
13+
runs-on: macos-latest
14+
permissions:
15+
contents: read
16+
pages: write
17+
id-token: write
18+
environment:
19+
name: github-pages
20+
url: ${{ steps.deployment.outputs.page_url }}
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Setup Rust
24+
uses: dtolnay/rust-toolchain@stable
25+
- name: Cache cargo
26+
uses: actions/cache@v4
27+
with:
28+
path: |
29+
~/.cargo/registry
30+
~/.cargo/git
31+
target
32+
key: ${{ runner.os }}-docs-cargo-${{ hashFiles('**/Cargo.lock') }}
33+
restore-keys: |
34+
${{ runner.os }}-docs-cargo-
35+
- name: Build documentation
36+
run: cargo doc --no-deps --all-features
37+
- name: Add redirect
38+
run: echo '<meta http-equiv="refresh" content="0; url=screencapturekit/index.html">' > target/doc/index.html
39+
- name: Setup Pages
40+
uses: actions/configure-pages@v4
41+
- name: Upload artifact
42+
uses: actions/upload-pages-artifact@v3
43+
with:
44+
path: target/doc
45+
- name: Deploy to GitHub Pages
46+
id: deployment
47+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)