-
Notifications
You must be signed in to change notification settings - Fork 26
36 lines (32 loc) · 1.15 KB
/
swift-check-api-breaks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Swift check API breaks
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize]
jobs:
analyze-api-breakage:
runs-on: [ubuntu-latest]
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Ubuntu deps
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt-get install -y libjemalloc-dev
- name: Extract default SPM library target
id: spm_target
run: |
SPM_DEFAULT_TARGET=$(swift package dump-package | jq -r '.products | .[] | select(.type | has("library")) | .name' | head -1)
echo "spmlibrarytarget=${SPM_DEFAULT_TARGET}" >> $GITHUB_ENV
- name: Build
if: ${{ env.spmlibrarytarget }}
run: swift build
- name: Analyze API breakage ((workaround compile issue on first run)
if: ${{ env.spmlibrarytarget }}
continue-on-error: true
run: swift package diagnose-api-breaking-changes origin/main --targets ${{ env.spmlibrarytarget }}
- name: Analyze API breakage
if: ${{ env.spmlibrarytarget }}
run: swift package diagnose-api-breaking-changes origin/main --targets ${{ env.spmlibrarytarget }}