Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/build-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
build-platforms:
runs-on: macos-15
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Comment thread
marandaneto marked this conversation as resolved.
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
build:
runs-on: macos-15-xlarge
Expand Down
22 changes: 16 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,25 @@ on:
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
lint:
swiftformat:
name: SwiftFormat
runs-on: macos-26
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3

- name: Install linting tools
run: |
brew install swiftlint swiftformat
- name: Check formatting
run: make swiftFormatCheck

swiftlint:
name: SwiftLint
runs-on: macos-26
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3

- name: Run lints
run: make lint
- name: Run SwiftLint
run: make swiftLintCheck
4 changes: 4 additions & 0 deletions .github/workflows/sdk-compliance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ on:
- 'sdk_compliance_adapter/**'
- '.github/workflows/sdk-compliance.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
compliance-tests:
# NOTE: Using macos-15-intel (Intel) instead of macos-26 (Apple Silicon)
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
test:
runs-on: macos-15
Expand Down
25 changes: 20 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: build buildSdk buildExamples format swiftLint swiftFormat test testDowngradeCompatibility testOniOSSimulator testOnMacSimulator lint bootstrap releaseCocoaPods api buildIOS
.PHONY: build buildSdk buildExamples format swiftLint swiftFormat swiftLintCheck swiftFormatCheck installSwiftLint installSwiftFormat test testDowngradeCompatibility testOniOSSimulator testOnMacSimulator lint bootstrap releaseCocoaPods api buildIOS

build: buildSdk buildExamples

Expand Down Expand Up @@ -67,12 +67,28 @@ buildExampleXCFramework:

format: swiftLint swiftFormat

swiftLint:
installSwiftLint:
@if ! command -v swiftlint >/dev/null 2>&1; then \
brew install swiftlint; \
fi

installSwiftFormat:
@if ! command -v swiftformat >/dev/null 2>&1; then \
brew install swiftformat; \
fi

swiftLint: installSwiftLint
swiftlint --fix

swiftFormat:
swiftFormat: installSwiftFormat
swiftformat . --swiftversion 5.3

swiftLintCheck: installSwiftLint
swiftlint

swiftFormatCheck: installSwiftFormat
swiftformat . --lint --swiftversion 5.3

# use -only-testing:PostHogTests/PostHogQueueTest to run only a specific test
# -retry-tests-on-failure -test-iterations 3: a few tests assert real-time behaviour (autocapture
# debounce/flush windows) that can't be made deterministic; on slow, load-variable CI runners those
Expand Down Expand Up @@ -100,8 +116,7 @@ testDowngradeCompatibility:
DOWNGRADE_REF="$${DOWNGRADE_REF:-3.48.0}" ./scripts/test-downgrade-compatibility.sh


lint:
swiftformat . --lint --swiftversion 5.3 && swiftlint
lint: swiftFormatCheck swiftLintCheck

# periphery scan --setup
# TODO: add periphery to the CI/commit prehooks
Expand Down
Loading