checks.yml 3.4 KB

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