CI: add diagnostic step to debug pkg-config resolution #20
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: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build: | |
| name: Build & Test | |
| runs-on: macos-14 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Select Xcode | |
| run: sudo xcode-select -s /Applications/Xcode_15.4.app | |
| - name: Install FreeTDS | |
| run: brew install freetds | |
| - name: Diagnose environment | |
| run: | | |
| echo "=== which pkg-config ===" | |
| which pkg-config || echo "NOT FOUND" | |
| echo "=== pkg-config freetds ===" | |
| pkg-config --cflags --libs freetds || echo "pkg-config freetds FAILED" | |
| echo "=== PKG_CONFIG_PATH ===" | |
| echo "${PKG_CONFIG_PATH:-empty}" | |
| echo "=== .pc files ===" | |
| find /opt/homebrew /usr/local -name "freetds.pc" 2>/dev/null || echo "no .pc file found" | |
| echo "=== brew --prefix freetds ===" | |
| brew --prefix freetds | |
| echo "=== ls pkgconfig dirs ===" | |
| ls /opt/homebrew/lib/pkgconfig/ 2>/dev/null | grep -i free || echo "none" | |
| ls /usr/local/lib/pkgconfig/ 2>/dev/null | grep -i free || echo "none" | |
| - name: Build | |
| run: swift build -v | |
| env: | |
| PKG_CONFIG_PATH: /opt/homebrew/lib/pkgconfig:/usr/local/lib/pkgconfig | |
| - name: Test | |
| run: swift test -v | |
| env: | |
| PKG_CONFIG_PATH: /opt/homebrew/lib/pkgconfig:/usr/local/lib/pkgconfig | |
| HOST: ${{ secrets.DB_HOST }} | |
| USERNAME: ${{ secrets.DB_USERNAME }} | |
| PASSWORD: ${{ secrets.DB_PASSWORD }} | |
| DATABASE: ${{ secrets.DB_DATABASE }} |