ci_docs.yml 3.2 KB

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