checks.yml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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@v3
  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@v3
  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@v3
  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. with:
  63. token: ${{ github.token }}
  64. tests-foundry:
  65. runs-on: ubuntu-latest
  66. steps:
  67. - uses: actions/checkout@v3
  68. with:
  69. submodules: recursive
  70. - name: Install Foundry
  71. uses: foundry-rs/foundry-toolchain@v1
  72. with:
  73. version: nightly
  74. - name: Run tests
  75. run: forge test -vv
  76. coverage:
  77. runs-on: ubuntu-latest
  78. steps:
  79. - uses: actions/checkout@v3
  80. - name: Set up environment
  81. uses: ./.github/actions/setup
  82. - run: npm run coverage
  83. - uses: codecov/codecov-action@v3
  84. with:
  85. token: ${{ secrets.CODECOV_TOKEN }}
  86. slither:
  87. runs-on: ubuntu-latest
  88. steps:
  89. - uses: actions/checkout@v3
  90. - name: Set up environment
  91. uses: ./.github/actions/setup
  92. - run: rm foundry.toml
  93. - uses: crytic/slither-action@v0.3.0
  94. with:
  95. node-version: 18.15
  96. codespell:
  97. runs-on: ubuntu-latest
  98. steps:
  99. - uses: actions/checkout@v3
  100. - name: Run CodeSpell
  101. uses: codespell-project/actions-codespell@v2.0
  102. with:
  103. check_hidden: true
  104. check_filenames: true
  105. skip: package-lock.json,*.pdf