name: Scan build (Static Analysis) on: workflow_call: inputs: freeswitch_ref: description: 'FreeSWITCH repository ref' required: false type: string sofia-sip_ref: description: 'Sofia-Sip repository ref' required: false type: string jobs: scan-build: runs-on: ubuntu-latest container: image: signalwire/freeswitch-public-ci-base:bookworm-amd64 options: --privileged env: DEBIAN_FRONTEND: noninteractive steps: - name: Checkout Sofia-Sip if: inputs.sofia-sip_ref == '' uses: actions/checkout@v4 with: repository: freeswitch/sofia-sip path: sofia-sip - name: Checkout Sofia-Sip (via ref) if: inputs.sofia-sip_ref != '' uses: actions/checkout@v4 with: repository: freeswitch/sofia-sip ref: ${{ inputs.sofia-sip_ref }} path: sofia-sip - name: Checkout FreeSWITCH (via ref) if: inputs.freeswitch_ref != '' uses: actions/checkout@v4 with: ref: ${{ inputs.freeswitch_ref }} path: freeswitch - name: Checkout FreeSWITCH if: inputs.freeswitch_ref == '' uses: actions/checkout@v4 with: path: freeswitch - name: Configure, Build and Install Sofia-Sip shell: bash working-directory: freeswitch run: | ./ci.sh -t scan-build -a configure -c sofia-sip -p "$GITHUB_WORKSPACE/sofia-sip" ./ci.sh -t scan-build -a build -c sofia-sip -p "$GITHUB_WORKSPACE/sofia-sip" ./ci.sh -t scan-build -a install -c sofia-sip -p "$GITHUB_WORKSPACE/sofia-sip" - name: Configure FreeSWITCH shell: bash working-directory: freeswitch run: | ./ci.sh -t scan-build -a configure -c freeswitch -p "$GITHUB_WORKSPACE/freeswitch" - name: Run scan-build analysis shell: bash working-directory: freeswitch run: | ./ci.sh -t scan-build -a build -c freeswitch -p "$GITHUB_WORKSPACE/freeswitch" - name: Check analysis results if: always() shell: bash working-directory: freeswitch run: | ./ci.sh -t scan-build -a validate -c freeswitch -p "$GITHUB_WORKSPACE/freeswitch" - name: Upload Scan-Build logs if: failure() uses: actions/upload-artifact@v4 with: name: scan-build-logs path: freeswitch/scan-build if-no-files-found: ignore compression-level: 9 - name: Notify run tests result to slack if: | failure() && github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/v1.10') uses: signalwire/actions-template/.github/actions/slack@main with: CHANNEL: ${{ secrets.SLACK_DEVOPS_CI_CHANNEL }} MESSAGE: Scan-Build ${{ github.repository }} > <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.run_id }}>. Static analysis failed. env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}