ci.yml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. name: CI
  2. on:
  3. pull_request:
  4. branches:
  5. - master
  6. jobs:
  7. scan_build:
  8. runs-on: ubuntu-latest
  9. container:
  10. image: debian:buster
  11. steps:
  12. - name: install deps
  13. run: |
  14. apt-get update && apt-get install -yq build-essential autotools-dev lsb-release pkg-config automake autoconf libtool-bin clang-tools-7
  15. apt-get install -yq cmake uuid-dev libssl-dev
  16. - name: Checkout
  17. uses: actions/checkout@v3
  18. - run: pwd
  19. - id: scan_build
  20. run: ./scan_build.sh
  21. - name: Tar logs
  22. id: tar
  23. if: failure()
  24. env:
  25. COMPILATION_FAILED: ${{ steps.scan_build.outputs.COMPILATION_FAILED }}
  26. BUGS_FOUND: ${{ steps.scan_build.outputs.BUGS_FOUND }}
  27. run: |
  28. ls -l
  29. if [ "true" -eq $COMPILATION_FAILED ]; then
  30. tar czvf scan-build-result.tar.gz ./scan-build-result.txt;
  31. echo "ARTIFACT_PATH=/__w/libks/libks/scan-build-result.tar.gz" >> $GITHUB_OUTPUT;
  32. echo "ARTIFACT=scan-build-result" >> $GITHUB_OUTPUT;
  33. fi
  34. if [ "true" -eq $BUGS_FOUND ]; then
  35. tar czvf reports.tar.gz $REPORT;
  36. echo "ARTIFACT_PATH=/__w/libks/libks/reports.tar.gz" >> $GITHUB_OUTPUT;
  37. echo "ARTIFACT=reports" >> $GITHUB_OUTPUT;
  38. fi
  39. - name: Upload artifacts
  40. if: failure()
  41. uses: actions/upload-artifact@v3
  42. with:
  43. name: ${{ steps.tar.outputs.ARTIFACT }}-${{ github.sha }}-${{ github.run_id }}
  44. path: ${{ steps.tar.outputs.ARTIFACT_PATH }}
  45. retention-days: 5
  46. - name: notify slack
  47. if: failure()
  48. uses: signalwire/actions-template/.github/actions/slack@main
  49. with:
  50. CHANNEL: CCS2AV2H2
  51. 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.
  52. env:
  53. SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
  54. run_tests:
  55. runs-on: ubuntu-latest
  56. container:
  57. image: debian:buster
  58. steps:
  59. - name: Checkout
  60. uses: actions/checkout@v3
  61. - name: run tests
  62. id: tests
  63. run: ./run_tests.sh
  64. - name: Upload artifacts
  65. if: failure()
  66. uses: actions/upload-artifact@v3
  67. with:
  68. name: test-artifacts-${{ github.sha }}-${{ github.run_id }}.html
  69. path: ${{ steps.tests.outputs.TEST_ARTIFACT_FILE }}
  70. retention-days: 5
  71. - name: notify slack
  72. if: failure()
  73. uses: signalwire/actions-template/.github/actions/slack@main
  74. with:
  75. CHANNEL: CCS2AV2H2
  76. MESSAGE: Test-Failure ${{ github.repository }} > <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.run_id }}>.\nPlease check the results.
  77. env:
  78. SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}