build.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. name: Build
  2. on: [push, pull_request, workflow_dispatch]
  3. env:
  4. BUILD_TYPE: Release
  5. jobs:
  6. build:
  7. runs-on: ubuntu-latest
  8. steps:
  9. - uses: actions/checkout@v2
  10. with:
  11. submodules: true
  12. - name: Apt update
  13. run: sudo apt-get update
  14. - name: Install dependencies
  15. run: sudo apt-get install doxygen libsnmp-dev python3-pip texlive-latex-recommended texlive-fonts-recommended tex-gyre texlive-latex-extra latexmk
  16. - name: Install Python dependencies
  17. run: pip3 install -r ${{github.workspace}}/doc/requirements.txt
  18. - name: Show Python dependencies
  19. run: pip3 freeze
  20. - name: Configure
  21. shell: bash
  22. run: |
  23. cmake -E make_directory ${{github.workspace}}/build
  24. cmake -B ${{github.workspace}}/build -S ${{github.workspace}} \
  25. -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
  26. -DPNET_OPTION_SNMP=ON
  27. - name: Build
  28. shell: bash
  29. run: |
  30. cmake --build ${{github.workspace}}/build --target all install -j4
  31. - name: Test
  32. shell: bash
  33. run: |
  34. cmake --build ${{github.workspace}}/build --target check
  35. - name: Codespell
  36. shell: bash
  37. run: |
  38. cmake --build ${{github.workspace}}/build --target codespell
  39. - name: HTML documentation
  40. shell: bash
  41. run: |
  42. cmake --build ${{github.workspace}}/build --target sphinx-html
  43. - name: Store HTML documentation artifact
  44. uses: actions/upload-artifact@v3
  45. with:
  46. name: pnet-html
  47. path: ${{github.workspace}}/build/doc/sphinx/html/
  48. - name: PDF documentation
  49. shell: bash
  50. run: |
  51. cmake --build ${{github.workspace}}/build --target sphinx-pdf
  52. - name: Store PDF documentation artifact
  53. uses: actions/upload-artifact@v3
  54. with:
  55. name: pnet-pdf
  56. path: ${{github.workspace}}/build/doc/sphinx/latex/p-net.pdf