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 proceduraly generated contracts are up-to-date
  40. run: npm run test:generation
  41. - name: Compare gas costs
  42. uses: ./.github/actions/gas-compare
  43. with:
  44. token: ${{ github.token }}
  45. tests-upgradeable:
  46. runs-on: ubuntu-latest
  47. env:
  48. FORCE_COLOR: 1
  49. steps:
  50. - uses: actions/checkout@v4
  51. with:
  52. fetch-depth: 0 # Include history so patch conflicts are resolved automatically
  53. - name: Set up environment
  54. uses: ./.github/actions/setup
  55. - name: Copy non-upgradeable contracts as dependency
  56. run: |
  57. mkdir -p lib/openzeppelin-contracts
  58. cp -rnT contracts lib/openzeppelin-contracts/contracts
  59. - name: Transpile to upgradeable
  60. run: bash scripts/upgradeable/transpile.sh
  61. - name: Run tests
  62. run: npm run test
  63. - name: Check linearisation of the inheritance graph
  64. run: npm run test:inheritance
  65. - name: Check storage layout
  66. uses: ./.github/actions/storage-layout
  67. continue-on-error: ${{ contains(github.event.pull_request.labels.*.name, 'breaking change') }}
  68. with:
  69. token: ${{ github.token }}
  70. tests-foundry:
  71. runs-on: ubuntu-latest
  72. steps:
  73. - uses: actions/checkout@v4
  74. with:
  75. submodules: recursive
  76. - name: Set up environment
  77. uses: ./.github/actions/setup
  78. - name: Run tests
  79. run: forge test -vv
  80. coverage:
  81. runs-on: ubuntu-latest
  82. steps:
  83. - uses: actions/checkout@v4
  84. - name: Set up environment
  85. uses: ./.github/actions/setup
  86. - name: Run coverage
  87. run: npm run coverage
  88. - uses: codecov/codecov-action@v4
  89. env:
  90. CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
  91. harnesses:
  92. runs-on: ubuntu-latest
  93. steps:
  94. - uses: actions/checkout@v4
  95. - name: Set up environment
  96. uses: ./.github/actions/setup
  97. - name: Compile harnesses
  98. run: |
  99. make -C certora apply
  100. npm run compile:harnesses
  101. slither:
  102. runs-on: ubuntu-latest
  103. steps:
  104. - uses: actions/checkout@v4
  105. - name: Set up environment
  106. uses: ./.github/actions/setup
  107. - run: rm foundry.toml
  108. - uses: crytic/slither-action@v0.4.0
  109. with:
  110. node-version: 18.15
  111. slither-version: 0.10.1
  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