Skip to content

chore: update ci workflow #49

chore: update ci workflow

chore: update ci workflow #49

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
if: ${{ env.spmlibrarytarget }}
run: swift package diagnose-api-breaking-changes origin/main --targets ${{ env.spmlibrarytarget }}