Export internal symbols for shared library builds (#1283) #29
Workflow file for this run
This file contains hidden or 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: ABI Compatibility Check | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| pull-requests: write | |
| jobs: | |
| check-abi: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y cmake build-essential abigail-tools | |
| - name: Build | |
| run: | | |
| cmake -B build -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Debug -DFTXUI_BUILD_EXAMPLES=OFF -DFTXUI_BUILD_TESTS=OFF -DFTXUI_BUILD_DOCS=OFF | |
| cmake --build build --parallel | |
| - name: Run ABI check | |
| id: abi_check | |
| run: | | |
| # Ensure the base branch is fetched | |
| git fetch origin ${{ github.base_ref }} | |
| # Optimization: Generate current fingerprint and compare with base | |
| ./tools/generate_abi_fingerprint.sh build > current_fingerprint.txt | |
| BASE_FINGERPRINT=$(git show origin/${{ github.base_ref }}:tools/abi_fingerprint.txt 2>/dev/null || echo "none") | |
| CURRENT_FINGERPRINT=$(cat current_fingerprint.txt) | |
| if [ "$BASE_FINGERPRINT" == "$CURRENT_FINGERPRINT" ]; then | |
| echo "### ✅ ABI Compatibility Report" > abi_comment.md | |
| echo "ABI fingerprints match (\`$CURRENT_FINGERPRINT\`). No changes detected." >> abi_comment.md | |
| echo "ABI_STATUS=unchanged" >> $GITHUB_ENV | |
| else | |
| echo "ABI fingerprints differ. Performing deep analysis..." | |
| # Run the script and capture output | |
| ./tools/check_abi_change.sh origin/${{ github.base_ref }} HEAD > abi_report.txt 2>&1 || echo "ABI_FAILED=true" >> $GITHUB_ENV | |
| # Format the output for a PR comment | |
| { | |
| echo "### ⚠️ ABI Compatibility Report" | |
| echo "Comparing \`${{ github.base_ref }}\` (base) with \`HEAD\` (PR)" | |
| echo "" | |
| echo "ABI fingerprints changed from \`$BASE_FINGERPRINT\` to \`$CURRENT_FINGERPRINT\`." | |
| echo "" | |
| echo "<details><summary>Detailed ABI Analysis</summary>" | |
| echo "" | |
| echo "\`\`\`" | |
| # Strip ANSI colors for the markdown comment | |
| sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" abi_report.txt | |
| echo "\`\`\`" | |
| echo "</details>" | |
| } > abi_comment.md | |
| echo "ABI_STATUS=changed" >> $GITHUB_ENV | |
| fi | |
| - name: Post comment | |
| uses: marocchino/sticky-pull-request-comment@v2 | |
| with: | |
| path: abi_comment.md | |
| - name: Fail if ABI broken | |
| if: env.ABI_FAILED == 'true' | |
| run: | | |
| echo "ABI changes detected. Please review the report in the PR comment." | |
| exit 1 |