version bump to 2.0.5 (#145) #161
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: | |
| pull_request: | |
| types: | |
| - synchronize | |
| - opened | |
| branches: | |
| - "master" | |
| push: | |
| branches: | |
| - "master" | |
| jobs: | |
| scan_build: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: debian:buster | |
| steps: | |
| - name: Install Deps | |
| run: | | |
| cat << 'EOF' | tee /etc/apt/sources.list | |
| deb http://archive.debian.org/debian buster main contrib | |
| deb http://archive.debian.org/debian-security buster/updates main contrib | |
| deb http://archive.debian.org/debian buster-updates main contrib | |
| EOF | |
| apt-get update && apt-get upgrade -y | |
| apt-get install -y \ | |
| autoconf \ | |
| automake \ | |
| autotools-dev \ | |
| build-essential \ | |
| clang-tools-7 \ | |
| cmake \ | |
| libssl-dev \ | |
| libtool-bin \ | |
| lsb-release \ | |
| pkg-config \ | |
| uuid-dev | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Сlone libks | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: signalwire/libks | |
| ref: v2.0 | |
| path: /__w/signalwire-c/signalwire-c/libks | |
| - name: Build libks | |
| working-directory: /__w/signalwire-c/signalwire-c/libks | |
| run: cmake . -DCMAKE_BUILD_TYPE=Release && make && make install | |
| - name: Scan build | |
| id: scan_build | |
| working-directory: /__w/signalwire-c/signalwire-c/ | |
| run: ./scan_build.sh | |
| - name: Tar logs | |
| id: tar | |
| if: failure() | |
| shell: bash | |
| working-directory: /__w/signalwire-c/signalwire-c/ | |
| env: | |
| COMPILATION_FAILED: ${{ steps.scan_build.outputs.COMPILATION_FAILED }} | |
| BUGS_FOUND: ${{ steps.scan_build.outputs.BUGS_FOUND }} | |
| run: | | |
| if [ "$COMPILATION_FAILED" = "true" ]; then | |
| tar czvf scan-build-result.tar.gz ./scan-build-result.txt; | |
| echo "ARTIFACT_PATH=scan-build-result.tar.gz" >> $GITHUB_OUTPUT; | |
| echo "ARTIFACT=scan-build-result" >> $GITHUB_OUTPUT; | |
| fi | |
| if [ "$BUGS_FOUND" = "true" ]; then | |
| tar czvf reports.tar.gz $REPORT; | |
| echo "ARTIFACT_PATH=reports.tar.gz" >> $GITHUB_OUTPUT; | |
| echo "ARTIFACT=reports" >> $GITHUB_OUTPUT; | |
| fi | |
| - name: Upload artifacts | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ steps.tar.outputs.ARTIFACT }}-${{ github.sha }}-${{ github.run_id }} | |
| path: /__w/signalwire-c/signalwire-c/${{ steps.tar.outputs.ARTIFACT_PATH }} | |
| retention-days: 5 | |
| - name: Comment on PR | |
| if: ${{ failure() && github.event_name == 'pull_request' }} | |
| uses: thollander/actions-comment-pull-request@v3 | |
| with: | |
| message: | | |
| scan_build _*failed*_. | |
| Please checkout the results. | |
| Action Run: [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) | |
| - name: Notify Slack | |
| if: ${{ failure() && github.event_name == 'push' }} | |
| uses: signalwire/actions-template/.github/actions/slack@main | |
| with: | |
| CHANNEL: ${{ secrets.SLACK_CHANNEL_ID }} | |
| MESSAGE: Scan-build ${{ github.repository }} > <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.run_id }}>.\n ${{ steps.scan_build.outputs.MESSAGE }}}.\nPlease check the results. | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |