analysis_codeql.yml 3.7 KB

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