analysis_codeql.yml 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. name: Analyse servers with CodeQL
  2. # analysis_codeql.yml
  3. concurrency:
  4. group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
  5. cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
  6. on:
  7. push:
  8. branches:
  9. - master
  10. pull_request:
  11. paths:
  12. # Always trigger all Github Actions if an action or something CI related was changed
  13. - '.github/workflows/**'
  14. - 'tools/ci/**'
  15. # This workflow should run when a file in a source directory has been modified.
  16. - 'src/**'
  17. - '3rdparty/**'
  18. jobs:
  19. analyze:
  20. # Github Actions checks for '[ci skip]', '[skip ci]', '[no ci]', '[skip actions]', or '[actions skip]' but not a hyphenated version.
  21. # It's a catch-all incase a Pull Request has been opened and someone is on auto-pilot.
  22. if: "!contains(github.event.head_commit.message, 'ci-skip')"
  23. runs-on: ${{ matrix.os }}
  24. strategy:
  25. fail-fast: false
  26. matrix:
  27. # The ubuntu-latest label currently points to ubuntu-20.04.
  28. # Available: ubuntu-22.04, ubuntu-20.04
  29. os: [ubuntu-latest]
  30. # Older versions of GCC are not available via unaltered aptitude repo lists.
  31. gcc: ['10']
  32. # We run build checks for both Renewal and PRE-Renewal
  33. mode: ['PRE','RE']
  34. steps:
  35. - name: Checkout repository
  36. uses: actions/checkout@v3
  37. # Initializes the CodeQL tools for scanning.
  38. - name: Initialize CodeQL
  39. uses: github/codeql-action/init@v2
  40. with:
  41. # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
  42. # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
  43. languages: cpp
  44. # Trigger security and quality findings
  45. # https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
  46. # TODO: Resolve the issues and then enable it again
  47. #queries: +security-and-quality
  48. # A simple 'yes' and 'no' can be confusing, so we use names to display in the current job then convert them for use in the compiler.
  49. - name: Variable Parsing - PRE
  50. if: ${{ matrix.mode == 'PRE' }}
  51. run: |
  52. echo "PRERE=yes" >> $GITHUB_ENV
  53. - name: Variable Parsing - RE
  54. if: ${{ matrix.mode == 'RE' }}
  55. run: |
  56. echo "PRERE=no" >> $GITHUB_ENV
  57. - name: Update & Install packages
  58. # Ubuntu runners already have most of the packages rAthena requires to build.
  59. # https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md
  60. run: |
  61. sudo apt update
  62. sudo apt install zlib1g-dev libpcre3-dev gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }}
  63. # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
  64. # If this step fails, then you should remove it and run the build manually (see below)
  65. #- name: Autobuild
  66. # uses: github/codeql-action/autobuild@v2
  67. # ✏️ If the Autobuild fails above, remove it and uncomment the following
  68. # three lines and modify them (or add more) to build your code if your
  69. # project uses a compiled language
  70. - name: Command - configure
  71. env:
  72. CONFIGURE_FLAGS: 'CC=gcc-${{ matrix.gcc }} CXX=g++-${{ matrix.gcc }} --enable-prere=${{ env.PRERE }} --enable-buildbot=yes'
  73. run: ./configure $CONFIGURE_FLAGS
  74. - name: Command - make clean
  75. run: make clean
  76. - name: Command - make server
  77. run: make server
  78. - name: Perform CodeQL Analysis
  79. uses: github/codeql-action/analyze@v2