checks.yml 3.3 KB

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