11name : CI
22
33on :
4+ workflow_call :
5+ inputs :
6+ checkout_ref :
7+ description : Git ref to check out
8+ required : false
9+ type : string
10+ default : " "
411 push :
512 branches : [main]
613 # Run on every pull request regardless of base branch so stacked PRs that
714 # target another feature branch (not just main) still get the full test,
815 # lint, and e2e suite. The expensive desktop/tauri bundle builds are gated
916 # to main separately in desktop-artifacts.yml.
10- pull_request :
11-
1217concurrency :
1318 group : ${{ github.workflow }}-${{ github.head_ref || github.ref }}
1419 cancel-in-progress : true
@@ -18,10 +23,11 @@ permissions:
1823
1924jobs :
2025 lint :
21- runs-on : ubuntu-latest
26+ runs-on : ${{ (github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.repo.full_name == github.repository)) && 'kenn-linux-x64-public' || ' ubuntu-latest' }}
2227 steps :
2328 - uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
2429 with :
30+ ref : ${{ inputs.checkout_ref || github.sha }}
2531 persist-credentials : false
2632
2733 - uses : actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
@@ -37,10 +43,11 @@ jobs:
3743 run : make lint-ci
3844
3945 frontend :
40- runs-on : ubuntu-latest
46+ runs-on : ${{ (github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.repo.full_name == github.repository)) && 'kenn-linux-x64-public' || ' ubuntu-latest' }}
4147 steps :
4248 - uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
4349 with :
50+ ref : ${{ inputs.checkout_ref || github.sha }}
4451 persist-credentials : false
4552
4653 - uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
@@ -67,10 +74,11 @@ jobs:
6774 working-directory : frontend
6875
6976 frontend-node-25 :
70- runs-on : ubuntu-latest
77+ runs-on : ${{ (github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.repo.full_name == github.repository)) && 'kenn-linux-x64-public' || ' ubuntu-latest' }}
7178 steps :
7279 - uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
7380 with :
81+ ref : ${{ inputs.checkout_ref || github.sha }}
7482 persist-credentials : false
7583
7684 - uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
@@ -86,10 +94,11 @@ jobs:
8694 working-directory : frontend
8795
8896 docs :
89- runs-on : ubuntu-latest
97+ runs-on : ${{ (github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.repo.full_name == github.repository)) && 'kenn-linux-x64-public' || ' ubuntu-latest' }}
9098 steps :
9199 - uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
92100 with :
101+ ref : ${{ inputs.checkout_ref || github.sha }}
93102 persist-credentials : false
94103
95104 - uses : actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
@@ -108,10 +117,11 @@ jobs:
108117 run : make docs-check
109118
110119 scripts :
111- runs-on : ubuntu-latest
120+ runs-on : ${{ (github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.repo.full_name == github.repository)) && 'kenn-linux-x64-public' || ' ubuntu-latest' }}
112121 steps :
113122 - uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
114123 with :
124+ ref : ${{ inputs.checkout_ref || github.sha }}
115125 persist-credentials : false
116126
117127 - name : Run shell script tests
@@ -124,14 +134,15 @@ jobs:
124134
125135 test :
126136 name : Go Test (${{ matrix.os }})
127- runs-on : ${{ matrix.os }}
137+ runs-on : ${{ contains(fromJSON('["ubuntu-latest","ubuntu-24.04","ubuntu-22.04"]'), matrix.os) && (github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.repo.full_name == github.repository)) && 'kenn-linux-x64-public' || matrix.os }}
128138 strategy :
129139 fail-fast : false
130140 matrix :
131141 os : [ubuntu-latest, windows-latest]
132142 steps :
133143 - uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
134144 with :
145+ ref : ${{ inputs.checkout_ref || github.sha }}
135146 fetch-depth : 0
136147 persist-credentials : false
137148
@@ -185,6 +196,7 @@ jobs:
185196 steps :
186197 - uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
187198 with :
199+ ref : ${{ inputs.checkout_ref || github.sha }}
188200 persist-credentials : false
189201
190202 - name : Prepare placeholder sidecar resource
@@ -215,10 +227,11 @@ jobs:
215227 run : cargo test --locked --manifest-path desktop/src-tauri/Cargo.toml --lib install_downloaded_update
216228
217229 coverage :
218- runs-on : ubuntu-latest
230+ runs-on : ${{ (github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.repo.full_name == github.repository)) && 'kenn-linux-x64-public' || ' ubuntu-latest' }}
219231 steps :
220232 - uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
221233 with :
234+ ref : ${{ inputs.checkout_ref || github.sha }}
222235 fetch-depth : 0
223236 persist-credentials : false
224237
@@ -246,7 +259,7 @@ jobs:
246259 run : echo "::warning::Codecov upload failed"
247260
248261 integration :
249- runs-on : ubuntu-latest
262+ runs-on : ${{ (github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.repo.full_name == github.repository)) && 'kenn-linux-x64-public' || ' ubuntu-latest' }}
250263 services :
251264 postgres :
252265 image : pgvector/pgvector:pg18
@@ -264,6 +277,7 @@ jobs:
264277 steps :
265278 - uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
266279 with :
280+ ref : ${{ inputs.checkout_ref || github.sha }}
267281 fetch-depth : 0
268282 persist-credentials : false
269283
@@ -312,10 +326,11 @@ jobs:
312326 TEST_SSH_KEY : ${{ github.workspace }}/testdata/ssh/test_key
313327
314328 e2e :
315- runs-on : ubuntu-latest
329+ runs-on : ${{ (github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.repo.full_name == github.repository)) && 'kenn-linux-x64-public' || ' ubuntu-latest' }}
316330 steps :
317331 - uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
318332 with :
333+ ref : ${{ inputs.checkout_ref || github.sha }}
319334 fetch-depth : 0
320335 persist-credentials : false
321336
0 commit comments