ci_docs.yml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. name: Nim Docs CI
  2. on:
  3. push:
  4. paths:
  5. - 'compiler/docgen.nim'
  6. - 'compiler/renderverbatim.nim'
  7. - 'config/nimdoc.cfg'
  8. - 'doc/**.rst'
  9. - 'doc/**.md'
  10. - 'doc/nimdoc.css'
  11. - 'lib/**.nim'
  12. - 'nimdoc/testproject/expected/testproject.html'
  13. - 'tools/dochack/dochack.nim'
  14. - 'tools/kochdocs.nim'
  15. - '.github/workflows/ci_docs.yml'
  16. - 'koch.nim'
  17. pull_request:
  18. # Run only on changes on these files.
  19. paths:
  20. - 'compiler/docgen.nim'
  21. - 'compiler/renderverbatim.nim'
  22. - 'config/nimdoc.cfg'
  23. - 'doc/**.rst'
  24. - 'doc/**.md'
  25. - 'doc/nimdoc.css'
  26. - 'lib/**.nim'
  27. - 'nimdoc/testproject/expected/testproject.html'
  28. - 'tools/dochack/dochack.nim'
  29. - 'tools/kochdocs.nim'
  30. - '.github/workflows/ci_docs.yml'
  31. - 'koch.nim'
  32. concurrency:
  33. group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  34. cancel-in-progress: true
  35. jobs:
  36. build:
  37. strategy:
  38. fail-fast: false
  39. matrix:
  40. target: [linux, windows, osx]
  41. include:
  42. - target: linux
  43. os: ubuntu-20.04
  44. - target: windows
  45. os: windows-2019
  46. - target: osx
  47. os: macos-11
  48. name: ${{ matrix.target }}
  49. runs-on: ${{ matrix.os }}
  50. timeout-minutes: 60 # refs bug #18178
  51. steps:
  52. - name: 'Checkout'
  53. uses: actions/checkout@v3
  54. with:
  55. fetch-depth: 2
  56. - name: 'Install build dependencies (macOS)'
  57. if: runner.os == 'macOS'
  58. run: brew install make
  59. - name: 'Install build dependencies (Windows)'
  60. if: runner.os == 'Windows'
  61. shell: bash
  62. run: |
  63. set -e
  64. . ci/funs.sh
  65. nimInternalInstallDepsWindows
  66. echo "${{ github.workspace }}/dist/mingw64/bin" >> "${GITHUB_PATH}"
  67. - name: 'Add build binaries to PATH'
  68. shell: bash
  69. run: echo "${{ github.workspace }}/bin" >> "${GITHUB_PATH}"
  70. - name: 'System information'
  71. shell: bash
  72. run: . ci/funs.sh && nimCiSystemInfo
  73. - name: 'Build csourcesAny (posix)'
  74. # this would work on windows and other CI use this on windows,
  75. # but we ensure here that `ci/build_autogen.bat` keeps working on windows.
  76. if: runner.os != 'Windows'
  77. shell: bash
  78. run: . ci/funs.sh && nimBuildCsourcesIfNeeded CC=gcc
  79. # was previously using caching via `actions/cache@v1` but this wasn't
  80. # used in other CI pipelines and it's unclear the added complexity
  81. # was worth the saving; can be revisited if needed.
  82. - name: 'Build csourcesAny (windows)'
  83. if: runner.os == 'Windows'
  84. shell: cmd
  85. run: ci/build_autogen.bat
  86. - name: 'Build koch'
  87. shell: bash
  88. run: nim c koch
  89. - name: 'Build the real compiler'
  90. shell: bash
  91. run: ./koch boot -d:release
  92. - name: 'Build documentation'
  93. shell: bash
  94. run: ./koch doc --git.commit:devel
  95. - name: 'Publish documentation to Github Pages'
  96. if: |
  97. github.event_name == 'push' && github.ref == 'refs/heads/devel' &&
  98. matrix.target == 'linux'
  99. uses: crazy-max/ghaction-github-pages@v3
  100. with:
  101. build_dir: doc/html
  102. env:
  103. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}