checks.yml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. - run: rm foundry.toml
  73. - uses: crytic/slither-action@v0.2.0
  74. codespell:
  75. if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
  76. runs-on: ubuntu-latest
  77. steps:
  78. - uses: actions/checkout@v3
  79. - name: Run CodeSpell
  80. uses: codespell-project/actions-codespell@v1.0
  81. with:
  82. check_filenames: true
  83. skip: package-lock.json