checks.yml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. name: checks
  2. on:
  3. push:
  4. branches:
  5. - master
  6. - release-v*
  7. pull_request: {}
  8. workflow_dispatch: {}
  9. concurrency:
  10. group: checks-${{ github.ref }}
  11. cancel-in-progress: true
  12. jobs:
  13. lint:
  14. if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
  15. runs-on: ubuntu-latest
  16. steps:
  17. - uses: actions/checkout@v3
  18. - name: Set up environment
  19. uses: ./.github/actions/setup
  20. - run: npm run lint
  21. tests:
  22. runs-on: ubuntu-latest
  23. env:
  24. FORCE_COLOR: 1
  25. NODE_OPTIONS: --max_old_space_size=4096
  26. GAS: true
  27. steps:
  28. - uses: actions/checkout@v3
  29. - name: Set up environment
  30. uses: ./.github/actions/setup
  31. - name: Run tests and generate gas report
  32. run: npm run test
  33. - name: Check linearisation of the inheritance graph
  34. run: npm run test:inheritance
  35. - name: Check proceduraly generated contracts are up-to-date
  36. if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
  37. run: npm run test:generation
  38. - name: Compare gas costs
  39. uses: ./.github/actions/gas-compare
  40. with:
  41. token: ${{ github.token }}
  42. - name: Check storage layout
  43. uses: ./.github/actions/storage-layout
  44. with:
  45. token: ${{ github.token }}
  46. foundry-tests:
  47. if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
  48. runs-on: ubuntu-latest
  49. steps:
  50. - uses: actions/checkout@v3
  51. with:
  52. submodules: recursive
  53. - name: Install Foundry
  54. uses: foundry-rs/foundry-toolchain@v1
  55. with:
  56. version: nightly
  57. - name: Run tests
  58. run: forge test -vv
  59. coverage:
  60. if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
  61. runs-on: ubuntu-latest
  62. steps:
  63. - uses: actions/checkout@v3
  64. - name: Set up environment
  65. uses: ./.github/actions/setup
  66. - run: npm run coverage
  67. env:
  68. NODE_OPTIONS: --max_old_space_size=4096
  69. - uses: codecov/codecov-action@v3
  70. with:
  71. token: ${{ secrets.CODECOV_TOKEN }}
  72. slither:
  73. if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
  74. runs-on: ubuntu-latest
  75. steps:
  76. - uses: actions/checkout@v3
  77. - name: Set up environment
  78. uses: ./.github/actions/setup
  79. - run: rm foundry.toml
  80. - uses: crytic/slither-action@v0.3.0
  81. with:
  82. node-version: 18
  83. codespell:
  84. if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
  85. runs-on: ubuntu-latest
  86. steps:
  87. - uses: actions/checkout@v3
  88. - name: Run CodeSpell
  89. uses: codespell-project/actions-codespell@v1.0
  90. with:
  91. check_filenames: true
  92. skip: package-lock.json,*.pdf