chore: update ci workflow #47
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |