checks.yml 3.1 KB

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