checks.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. GAS: true
  26. steps:
  27. - uses: actions/checkout@v3
  28. - name: Set up environment
  29. uses: ./.github/actions/setup
  30. - name: Run tests and generate gas report
  31. run: npm run test
  32. - name: Check linearisation of the inheritance graph
  33. run: npm run test:inheritance
  34. - name: Check proceduraly generated contracts are up-to-date
  35. if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
  36. run: npm run test:generation
  37. - name: Compare gas costs
  38. uses: ./.github/actions/gas-compare
  39. with:
  40. token: ${{ github.token }}
  41. foundry-tests:
  42. if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
  43. runs-on: ubuntu-latest
  44. steps:
  45. - uses: actions/checkout@v3
  46. with:
  47. submodules: recursive
  48. - name: Install Foundry
  49. uses: foundry-rs/foundry-toolchain@v1
  50. with:
  51. version: nightly
  52. - name: Run tests
  53. run: forge test -vv
  54. coverage:
  55. if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
  56. runs-on: ubuntu-latest
  57. steps:
  58. - uses: actions/checkout@v3
  59. - name: Set up environment
  60. uses: ./.github/actions/setup
  61. - run: npm run coverage
  62. env:
  63. NODE_OPTIONS: --max_old_space_size=4096
  64. - uses: codecov/codecov-action@v3
  65. slither:
  66. if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
  67. runs-on: ubuntu-latest
  68. steps:
  69. - uses: actions/checkout@v3
  70. - name: Set up environment
  71. uses: ./.github/actions/setup
  72. - uses: crytic/slither-action@v0.2.0
  73. codespell:
  74. if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
  75. runs-on: ubuntu-latest
  76. steps:
  77. - uses: actions/checkout@v3
  78. - name: Run CodeSpell
  79. uses: codespell-project/actions-codespell@v1.0
  80. with:
  81. check_filenames: true
  82. skip: package-lock.json