Skip to content

Commit f6d67c2

Browse files
committed
ci: accelerate selective verification
1 parent dbd7c75 commit f6d67c2

4 files changed

Lines changed: 81 additions & 7 deletions

File tree

.github/verification-paths.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
product:
2+
- ".github/**"
3+
- ".releaserc.json"
4+
- "Makefile"
5+
- "Package.swift"
6+
- "Sources/**"
7+
- "SlopwakeApp/**"
8+
- "Tests/**"
9+
- "VERSION"
10+
- "project.yml"
11+
- "scripts/**"

.github/workflows/ci.yml

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,44 @@ on:
1414
permissions: {}
1515

1616
jobs:
17-
verify:
17+
changes:
1818
if: ${{ github.event_name != 'push' || !contains(github.event.head_commit.message, '[skip ci]') }}
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 5
21+
permissions:
22+
contents: read
23+
pull-requests: read
24+
outputs:
25+
product: ${{ steps.filter.outputs.product }}
26+
steps:
27+
- name: Check out
28+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
29+
with:
30+
persist-credentials: false
31+
32+
- id: filter
33+
uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
34+
with:
35+
filters: .github/verification-paths.yml
36+
37+
verify-contract:
38+
if: ${{ github.event_name != 'push' || !contains(github.event.head_commit.message, '[skip ci]') }}
39+
runs-on: ubuntu-latest
40+
timeout-minutes: 5
41+
permissions:
42+
contents: read
43+
steps:
44+
- name: Check out
45+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
46+
with:
47+
persist-credentials: false
48+
49+
- name: Verify release contract
50+
run: make release-check
51+
52+
verify-product:
53+
needs: [changes]
54+
if: ${{ github.event_name != 'pull_request' || needs.changes.outputs.product == 'true' }}
1955
runs-on: macos-26
2056
timeout-minutes: 20
2157
permissions:
@@ -33,7 +69,25 @@ jobs:
3369
run: sudo xcode-select --switch /Applications/Xcode_26.6.app/Contents/Developer
3470

3571
- name: Verify
36-
run: make verify
72+
run: make verify-product-lanes -j3
73+
74+
verify:
75+
needs: [verify-contract, verify-product]
76+
if: ${{ always() && (github.event_name != 'push' || !contains(github.event.head_commit.message, '[skip ci]')) }}
77+
runs-on: ubuntu-latest
78+
timeout-minutes: 5
79+
permissions: {}
80+
steps:
81+
- name: Require selected verification
82+
env:
83+
CONTRACT_RESULT: ${{ needs.verify-contract.result }}
84+
PRODUCT_RESULT: ${{ needs.verify-product.result }}
85+
run: |
86+
test "${CONTRACT_RESULT}" = success
87+
case "${PRODUCT_RESULT}" in
88+
success|skipped) ;;
89+
*) exit 1 ;;
90+
esac
3791
3892
release:
3993
needs: [verify]

AGENTS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
## Start
44

55
- Require macOS 26+ and Xcode 26+.
6-
- Run `make verify` before handing off a completed change.
6+
- Run `make release-check` for docs-only changes. Run `make verify` for product,
7+
build, installer, release, or CI changes before handoff.
78
- Treat `project.yml` as canonical; `Slopwake.xcodeproj` is generated.
89

910
## Boundaries

Makefile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ SHELL := /bin/bash
33
HOST_ARCH := $(shell uname -m)
44
RELEASE_VERSION ?= $(shell sed -n '1p' VERSION)
55
BUILD_NUMBER ?= 1
6+
VERIFY_JOBS ?= 4
7+
TEST_DERIVED_DATA ?= DerivedData/Test
8+
BUILD_DERIVED_DATA ?= DerivedData/Build
69

7-
.PHONY: project test core-test app-test release-check build verify release clean
10+
.PHONY: project test core-test app-test release-check build verify verify-lanes verify-product-lanes release clean
811

912
project:
1013
./scripts/generate-project.sh
@@ -20,7 +23,7 @@ app-test: project
2023
-scheme Slopwake \
2124
-configuration Debug \
2225
-destination 'platform=macOS,arch=$(HOST_ARCH)' \
23-
-derivedDataPath DerivedData \
26+
-derivedDataPath $(TEST_DERIVED_DATA) \
2427
CODE_SIGN_IDENTITY=- \
2528
ONLY_ACTIVE_ARCH=YES \
2629
ARCHS=$(HOST_ARCH) \
@@ -35,7 +38,7 @@ build: project
3538
-scheme Slopwake \
3639
-configuration Release \
3740
-destination 'generic/platform=macOS' \
38-
-derivedDataPath DerivedData \
41+
-derivedDataPath $(BUILD_DERIVED_DATA) \
3942
CODE_SIGNING_ALLOWED=NO \
4043
MARKETING_VERSION=$(RELEASE_VERSION) \
4144
CURRENT_PROJECT_VERSION=$(BUILD_NUMBER) \
@@ -44,7 +47,12 @@ build: project
4447
release: build
4548
RELEASE_VERSION=$(RELEASE_VERSION) ./scripts/release.sh
4649

47-
verify: test release-check build
50+
verify:
51+
+$(MAKE) --no-print-directory -j$(VERIFY_JOBS) verify-lanes
52+
53+
verify-lanes: verify-product-lanes release-check
54+
55+
verify-product-lanes: core-test app-test build
4856

4957
clean:
5058
swift package clean

0 commit comments

Comments
 (0)