checks.yml 2.9 KB

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