ci_bench.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. name: Benchmarks CI
  2. on:
  3. pull_request:
  4. push:
  5. branches:
  6. - 'devel'
  7. jobs:
  8. build:
  9. strategy:
  10. fail-fast: false
  11. matrix:
  12. os: [ubuntu-20.04]
  13. cpu: [amd64]
  14. name: '${{ matrix.os }}'
  15. runs-on: ${{ matrix.os }}
  16. timeout-minutes: 60 # refs bug #18178
  17. steps:
  18. - name: 'Checkout'
  19. uses: actions/checkout@v4
  20. with:
  21. fetch-depth: 2
  22. - name: 'Install node.js 20.x'
  23. uses: actions/setup-node@v4
  24. with:
  25. node-version: '20.x'
  26. - name: 'Install dependencies (Linux amd64)'
  27. if: runner.os == 'Linux' && matrix.cpu == 'amd64'
  28. run: |
  29. sudo apt-fast update -qq
  30. DEBIAN_FRONTEND='noninteractive' \
  31. sudo apt-fast install --no-install-recommends -yq \
  32. libcurl4-openssl-dev libgc-dev libsdl1.2-dev libsfml-dev \
  33. valgrind libc6-dbg libblas-dev xorg-dev
  34. - name: 'Add build binaries to PATH'
  35. shell: bash
  36. run: echo "${{ github.workspace }}/bin" >> "${GITHUB_PATH}"
  37. - name: 'Build csourcesAny'
  38. shell: bash
  39. run: . ci/funs.sh && nimBuildCsourcesIfNeeded CC=gcc ucpu='${{ matrix.cpu }}'
  40. - name: 'Build koch'
  41. shell: bash
  42. run: nim c koch
  43. - name: 'Build Nim'
  44. shell: bash
  45. run: ./koch boot -d:release -d:nimStrictMode --lib:lib
  46. - name: 'Build Nimble'
  47. shell: bash
  48. run: ./koch nimble
  49. - name: 'Action'
  50. shell: bash
  51. run: nim c -r -d:release ci/action.nim
  52. - name: 'Checkout minimize'
  53. uses: actions/checkout@v4
  54. with:
  55. repository: 'nim-lang/ci_bench'
  56. path: minimize
  57. - name: 'Run minimize benchmarks'
  58. shell: bash
  59. run: ./minimize/minimize ci-bench
  60. - name: 'Restore minimize cached database'
  61. uses: actions/cache/restore@v3
  62. with:
  63. path: minimize.csv
  64. key: minimize-db-key
  65. - name: 'Update minimize db'
  66. shell: bash
  67. run: ./minimize/minimize update-db
  68. - name: 'Save minimize cached database'
  69. if: |
  70. github.event_name == 'push' && github.ref == 'refs/heads/devel' &&
  71. matrix.target == 'linux'
  72. uses: actions/cache/save@v3
  73. with:
  74. path: minimize.csv
  75. key: minimize-db-key
  76. - name: 'Generate minimize report'
  77. shell: bash
  78. run: ./minimize/minimize generate-report
  79. - name: 'Archive minimize report'
  80. uses: actions/upload-artifact@v3
  81. with:
  82. name: minimize-report
  83. path: |
  84. minimize/minimize.html
  85. minimize/minimize.csv
  86. # Requires additional permissions, see:
  87. # https://github.com/nim-lang/Nim/actions/runs/4778177321/jobs/8494423792?pr=21566
  88. # - name: 'Publish HTML report'
  89. # uses: rossjrw/pr-preview-action@v1
  90. # with:
  91. # source-dir: minimize
  92. # umbrella-dir: minimize
  93. # env:
  94. # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  95. - name: Extract md summary
  96. run: |
  97. cat minimize/summary.md >> $GITHUB_STEP_SUMMARY