checks.yml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. name: checks
  2. on:
  3. push:
  4. branches:
  5. - master
  6. - next-v*
  7. - release-v*
  8. pull_request: {}
  9. workflow_dispatch: {}
  10. concurrency:
  11. group: checks-${{ github.ref }}
  12. cancel-in-progress: true
  13. env:
  14. NODE_OPTIONS: --max_old_space_size=8192
  15. jobs:
  16. lint:
  17. runs-on: ubuntu-latest
  18. steps:
  19. - uses: actions/checkout@v4
  20. - name: Set up environment
  21. uses: ./.github/actions/setup
  22. - run: npm run lint
  23. tests:
  24. runs-on: ubuntu-latest
  25. env:
  26. FORCE_COLOR: 1
  27. # Needed for "eth-gas-reporter" to produce a "gasReporterOutput.json" as documented in
  28. # https://github.com/cgewecke/eth-gas-reporter/blob/v0.2.27/docs/gasReporterOutput.md
  29. CI: true
  30. GAS: true
  31. steps:
  32. - uses: actions/checkout@v4
  33. - name: Set up environment
  34. uses: ./.github/actions/setup
  35. - name: Run tests and generate gas report
  36. run: npm run test
  37. - name: Check linearisation of the inheritance graph
  38. run: npm run test:inheritance
  39. - name: Check pragma consistency between files
  40. run: npm run test:pragma
  41. - name: Check procedurally generated contracts are up-to-date
  42. run: npm run test:generation
  43. - name: Compare gas costs
  44. uses: ./.github/actions/gas-compare
  45. with:
  46. token: ${{ github.token }}
  47. tests-upgradeable:
  48. runs-on: ubuntu-latest
  49. env:
  50. FORCE_COLOR: 1
  51. steps:
  52. - uses: actions/checkout@v4
  53. with:
  54. fetch-depth: 0 # Include history so patch conflicts are resolved automatically
  55. - name: Set up environment
  56. uses: ./.github/actions/setup
  57. - name: Copy non-upgradeable contracts as dependency
  58. run: |
  59. mkdir -p lib/openzeppelin-contracts
  60. cp -rnT contracts lib/openzeppelin-contracts/contracts
  61. - name: Transpile to upgradeable
  62. run: bash scripts/upgradeable/transpile.sh
  63. - name: Run tests
  64. run: npm run test
  65. - name: Check linearisation of the inheritance graph
  66. run: npm run test:inheritance
  67. - name: Check pragma consistency between files
  68. run: npm run test:pragma
  69. - name: Check storage layout
  70. uses: ./.github/actions/storage-layout
  71. continue-on-error: ${{ contains(github.event.pull_request.labels.*.name, 'breaking change') }}
  72. with:
  73. token: ${{ github.token }}
  74. tests-foundry:
  75. runs-on: ubuntu-latest
  76. steps:
  77. - uses: actions/checkout@v4
  78. with:
  79. submodules: recursive
  80. - name: Set up environment
  81. uses: ./.github/actions/setup
  82. - name: Run tests
  83. run: forge test -vv
  84. coverage:
  85. runs-on: ubuntu-latest
  86. steps:
  87. - uses: actions/checkout@v4
  88. - name: Set up environment
  89. uses: ./.github/actions/setup
  90. - name: Run coverage
  91. run: npm run coverage
  92. - uses: codecov/codecov-action@v5
  93. env:
  94. CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
  95. harnesses:
  96. runs-on: ubuntu-latest
  97. steps:
  98. - uses: actions/checkout@v4
  99. - name: Set up environment
  100. uses: ./.github/actions/setup
  101. - name: Compile harnesses
  102. run: |
  103. make -C certora apply
  104. npm run compile:harnesses
  105. slither:
  106. runs-on: ubuntu-latest
  107. steps:
  108. - uses: actions/checkout@v4
  109. - name: Set up environment
  110. uses: ./.github/actions/setup
  111. - uses: crytic/slither-action@v0.4.0
  112. codespell:
  113. runs-on: ubuntu-latest
  114. steps:
  115. - uses: actions/checkout@v4
  116. - name: Run CodeSpell
  117. uses: codespell-project/actions-codespell@v2.1
  118. with:
  119. check_hidden: true
  120. check_filenames: true
  121. skip: package-lock.json,*.pdf,vendor