compile.yml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. name: Compile
  2. on:
  3. - pull_request
  4. - push
  5. concurrency:
  6. group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  7. cancel-in-progress: ${{ github.event_name == 'pull_request' }}
  8. permissions:
  9. actions: read
  10. packages: read
  11. contents: read
  12. jobs:
  13. compile:
  14. runs-on: ubuntu-latest
  15. timeout-minutes: 30
  16. strategy:
  17. fail-fast: false
  18. matrix:
  19. name:
  20. - GCC
  21. - GCC Strict
  22. - GCC Static Analyzer
  23. - Clang
  24. - Clang -Weverything
  25. include:
  26. - name: GCC
  27. image: quay.io/389ds/ci-images:fedora
  28. compiler: gcc
  29. cpp-compiler: g++
  30. cflags: "-O2 -g"
  31. - name: GCC strict
  32. image: quay.io/389ds/ci-images:fedora
  33. compiler: gcc
  34. cpp-compiler: g++
  35. cflags: "-O2 -g -Wall -Wextra -Wundef -Wpointer-arith -Wfloat-equal \
  36. -Wstrict-prototypes -Wstrict-overflow=5 -Wwrite-strings -Winit-self \
  37. -Wuninitialized -Wno-sign-compare -Wshadow -Wformat-security"
  38. - name: GCC Static Analyzer
  39. image: quay.io/389ds/ci-images:fedora
  40. compiler: gcc
  41. cpp-compiler: g++
  42. cflags: "-O2 -g -fanalyzer"
  43. - name: Clang
  44. image: quay.io/389ds/ci-images:fedora
  45. compiler: clang
  46. cpp-compiler: clang++
  47. cflags: "-O2 -g -Qunused-arguments"
  48. - name: Clang -Weverything
  49. image: quay.io/389ds/ci-images:fedora
  50. compiler: clang
  51. cpp-compiler: clang++
  52. cflags: "-O2 -g -Weverything -Qunused-arguments"
  53. container:
  54. image: ${{ matrix.image }}
  55. steps:
  56. - uses: actions/checkout@v6
  57. - name: Checkout and configure
  58. run: autoreconf -fvi && ./configure
  59. env:
  60. CC: ${{ matrix.compiler }}
  61. CXX: ${{ matrix.cpp-compiler }}
  62. CFLAGS: ${{ matrix.cflags || env.CFLAGS }}
  63. CXXFLAGS: ${{ matrix.cxxflags || env.CXXFLAGS }}
  64. LDFLAGS: ${{ matrix.ldflags || env.LDFLAGS }}
  65. - uses: ammaraskar/[email protected]
  66. - name: Build using ${{ matrix.compiler }}
  67. run: bash -c "(make V=0 2> >(tee /dev/stderr)) > log.txt"
  68. - uses: actions/upload-artifact@v7
  69. with:
  70. name: ${{ matrix.name }}
  71. path: log.txt