checks.yml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. jobs:
  14. lint:
  15. if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
  16. runs-on: ubuntu-latest
  17. steps:
  18. - uses: actions/checkout@v3
  19. - name: Set up environment
  20. uses: ./.github/actions/setup
  21. - run: npm run lint
  22. tests:
  23. runs-on: ubuntu-latest
  24. env:
  25. FORCE_COLOR: 1
  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. foundry-tests:
  43. if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
  44. runs-on: ubuntu-latest
  45. steps:
  46. - uses: actions/checkout@v3
  47. with:
  48. submodules: recursive
  49. - name: Install Foundry
  50. uses: foundry-rs/foundry-toolchain@v1
  51. with:
  52. version: nightly
  53. - name: Run tests
  54. run: forge test -vv
  55. coverage:
  56. if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
  57. runs-on: ubuntu-latest
  58. steps:
  59. - uses: actions/checkout@v3
  60. - name: Set up environment
  61. uses: ./.github/actions/setup
  62. - run: npm run coverage
  63. env:
  64. NODE_OPTIONS: --max_old_space_size=4096
  65. - uses: codecov/codecov-action@v3
  66. slither:
  67. if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
  68. runs-on: ubuntu-latest
  69. steps:
  70. - uses: actions/checkout@v3
  71. - name: Set up environment
  72. uses: ./.github/actions/setup
  73. - run: rm foundry.toml # https://github.com/foundry-rs/foundry/issues/3827
  74. - uses: crytic/slither-action@v0.2.0
  75. codespell:
  76. if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
  77. runs-on: ubuntu-latest
  78. steps:
  79. - uses: actions/checkout@v3
  80. - name: Run CodeSpell
  81. uses: codespell-project/actions-codespell@v1.0
  82. with:
  83. check_filenames: true
  84. skip: package-lock.json