codeql-analysis.yml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. steps:
  26. - name: Checkout repository
  27. uses: actions/checkout@v2
  28. with:
  29. # just fetching 1 commit is not enough for setuptools-scm, so we fetch all
  30. fetch-depth: 0
  31. - name: Set up Python
  32. uses: actions/setup-python@v2
  33. with:
  34. python-version: 3.9
  35. # Initializes the CodeQL tools for scanning.
  36. - name: Initialize CodeQL
  37. uses: github/codeql-action/init@v1
  38. with:
  39. languages: ${{ matrix.language }}
  40. # If you wish to specify custom queries, you can do so here or in a config file.
  41. # By default, queries listed here will override any specified in a config file.
  42. # Prefix the list here with "+" to use these queries and those in the config file.
  43. # queries: ./path/to/local/query, your-org/your-repo/queries@main
  44. - name: Cache pip
  45. uses: actions/cache@v2
  46. with:
  47. path: ~/.cache/pip
  48. key: ${{ runner.os }}-pip-${{ hashFiles('requirements.d/development.txt') }}
  49. restore-keys: |
  50. ${{ runner.os }}-pip-
  51. ${{ runner.os }}-
  52. # ℹ️ Command-line programs to run using the OS shell.
  53. # 📚 https://git.io/JvXDl
  54. - name: Install requirements, build and install Borg
  55. run: |
  56. sudo apt-get update
  57. sudo apt-get install -y pkg-config build-essential
  58. sudo apt-get install -y libssl-dev libacl1-dev libxxhash-dev liblz4-dev libzstd-dev
  59. python3 -m venv ../borg-env
  60. source ../borg-env/bin/activate
  61. pip3 install -r requirements.d/development.txt
  62. pip3 install -e .
  63. - name: Perform CodeQL Analysis
  64. uses: github/codeql-action/analyze@v1