codeql-analysis.yml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # CodeQL semantic code analysis engine
  2. name: "CodeQL"
  3. on:
  4. push:
  5. branches: [ master ]
  6. pull_request:
  7. # The branches below must be a subset of the branches above
  8. branches: [ master ]
  9. schedule:
  10. - cron: '39 2 * * 5'
  11. jobs:
  12. analyze:
  13. name: Analyze
  14. runs-on: ubuntu-latest
  15. permissions:
  16. actions: read
  17. contents: read
  18. security-events: write
  19. strategy:
  20. fail-fast: false
  21. matrix:
  22. language: [ 'cpp', 'python' ]
  23. # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
  24. # Learn more about CodeQL language support at https://git.io/codeql-language-support
  25. env:
  26. # nothing special right now
  27. steps:
  28. - name: Checkout repository
  29. uses: actions/checkout@v2
  30. with:
  31. # just fetching 1 commit is not enough for setuptools-scm, so we fetch all
  32. fetch-depth: 0
  33. - name: Set up Python
  34. uses: actions/setup-python@v2
  35. with:
  36. python-version: 3.9
  37. - name: Cache pip
  38. uses: actions/cache@v2
  39. with:
  40. path: ~/.cache/pip
  41. key: ${{ runner.os }}-pip-${{ hashFiles('requirements.d/development.txt') }}
  42. restore-keys: |
  43. ${{ runner.os }}-pip-
  44. ${{ runner.os }}-
  45. - name: Install requirements
  46. run: |
  47. sudo apt-get update
  48. sudo apt-get install -y pkg-config build-essential
  49. sudo apt-get install -y libssl-dev libacl1-dev libxxhash-dev liblz4-dev libzstd-dev
  50. # Initializes the CodeQL tools for scanning.
  51. - name: Initialize CodeQL
  52. uses: github/codeql-action/init@v1
  53. with:
  54. languages: ${{ matrix.language }}
  55. # If you wish to specify custom queries, you can do so here or in a config file.
  56. # By default, queries listed here will override any specified in a config file.
  57. # Prefix the list here with "+" to use these queries and those in the config file.
  58. # queries: ./path/to/local/query, your-org/your-repo/queries@main
  59. - name: Build and install Borg
  60. run: |
  61. python3 -m venv ../borg-env
  62. source ../borg-env/bin/activate
  63. pip3 install -r requirements.d/development.txt
  64. pip3 install -e .
  65. - name: Perform CodeQL Analysis
  66. uses: github/codeql-action/analyze@v1