checks.yml 3.0 KB

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