checks.yml 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. - name: Check storage layout
  42. uses: ./.github/actions/storage-layout
  43. with:
  44. token: ${{ github.token }}
  45. foundry-tests:
  46. if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
  47. runs-on: ubuntu-latest
  48. steps:
  49. - uses: actions/checkout@v3
  50. with:
  51. submodules: recursive
  52. - name: Install Foundry
  53. uses: foundry-rs/foundry-toolchain@v1
  54. with:
  55. version: nightly
  56. - name: Run tests
  57. run: forge test -vv
  58. coverage:
  59. if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
  60. runs-on: ubuntu-latest
  61. steps:
  62. - uses: actions/checkout@v3
  63. - name: Set up environment
  64. uses: ./.github/actions/setup
  65. - run: npm run coverage
  66. env:
  67. NODE_OPTIONS: --max_old_space_size=4096
  68. - uses: codecov/codecov-action@v3
  69. slither:
  70. if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
  71. runs-on: ubuntu-latest
  72. steps:
  73. - uses: actions/checkout@v3
  74. - name: Set up environment
  75. uses: ./.github/actions/setup
  76. - run: rm foundry.toml
  77. - uses: crytic/slither-action@v0.2.0
  78. codespell:
  79. if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
  80. runs-on: ubuntu-latest
  81. steps:
  82. - uses: actions/checkout@v3
  83. - name: Run CodeSpell
  84. uses: codespell-project/actions-codespell@v1.0
  85. with:
  86. check_filenames: true
  87. skip: package-lock.json,*.pdf