Repository navigation
Return original wolfSSL error from getError() instead of SSL_ERROR_SYSCALL #805
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: Clang Static Analyzer (scan-build) | |
| on: | |
| push: | |
| branches: [ 'master', 'main', 'release/**' ] | |
| pull_request: | |
| branches: [ '*' ] | |
| # Cancel superseded in-progress runs for the same PR. Runs | |
| # triggered by push events are never cancelled. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| scan-build: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Install scan-build (part of clang-tools) | |
| - name: Install scan-build | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y clang-tools | |
| # Cache the installed wolfSSL build. The key matches the one built | |
| # in linux-common.yml for the same configure flags, so this job | |
| # shares the cache with the main CI matrix. | |
| - name: Resolve wolfSSL cache key | |
| id: wolfssl-key | |
| env: | |
| WOLFSSL_CONFIGURE: '--enable-jni --enable-all' | |
| run: | | |
| SHA=$(git ls-remote https://github.com/wolfSSL/wolfssl.git \ | |
| refs/heads/master | cut -f1) | |
| if [ -z "$SHA" ]; then | |
| echo "Failed to resolve wolfSSL master SHA" >&2 | |
| exit 1 | |
| fi | |
| CFG_HASH=$(printf '%s' "$WOLFSSL_CONFIGURE" | \ | |
| shasum -a 256 | cut -c1-16) | |
| KEY="wolfssl-${{ runner.os }}-${{ runner.arch }}-$SHA-$CFG_HASH" | |
| echo "sha=$SHA" >> "$GITHUB_OUTPUT" | |
| echo "key=$KEY" >> "$GITHUB_OUTPUT" | |
| - name: Restore cached wolfSSL install | |
| id: cache-wolfssl | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: build-dir | |
| key: ${{ steps.wolfssl-key.outputs.key }} | |
| # Build native wolfSSL, using the exact commit the cache key was | |
| # computed from so the key and contents cannot drift if master | |
| # advances mid-run. | |
| - name: Build native wolfSSL | |
| if: steps.cache-wolfssl.outputs.cache-hit != 'true' | |
| uses: wolfSSL/actions-build-autotools-project@v1 | |
| with: | |
| repository: wolfSSL/wolfssl | |
| ref: ${{ steps.wolfssl-key.outputs.sha }} | |
| path: wolfssl | |
| configure: '--enable-jni --enable-all' | |
| check: false | |
| install: true | |
| # Save right after building (not at job end) so a later test | |
| # failure does not prevent the cache from being populated. | |
| - name: Save wolfSSL install to cache | |
| if: steps.cache-wolfssl.outputs.cache-hit != 'true' | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: build-dir | |
| key: ${{ steps.wolfssl-key.outputs.key }} | |
| # Setup Java | |
| - name: Setup java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '11' | |
| # Run scan-build over the native JNI C files. scan-build only | |
| # analyzes C compilations, so build the native target alone and | |
| # skip the Java side of the default make target. JUnit jars and | |
| # LD_LIBRARY_PATH are not needed since no tests run here. | |
| - name: Run scan-build | |
| env: | |
| PREFIX: ${{ github.workspace }}/build-dir | |
| run: | | |
| scan-build --status-bugs -o scan-build-reports make native | |
| # Upload scan-build results as artifacts | |
| - name: Upload scan-build results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: scan-build-reports | |
| path: scan-build-reports/ | |
| # Show scan-build results in logs | |
| - name: Show scan-build results | |
| if: always() | |
| run: | | |
| if [ -d "scan-build-reports" ]; then | |
| echo "=== Scan-build analysis complete ===" | |
| find scan-build-reports -name "*.html" -exec echo "Report: {}" \; | |
| if find scan-build-reports -name "*.html" | head -1 | xargs grep -l "No bugs found" > /dev/null 2>&1; then | |
| echo "✅ No static analysis issues found" | |
| else | |
| echo "⚠️ Static analysis issues detected - check artifacts" | |
| find scan-build-reports -name "*.txt" -exec cat {} \; || true | |
| fi | |
| else | |
| echo "No scan-build reports generated" | |
| fi |