checks.yml 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. slither:
  71. if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
  72. runs-on: ubuntu-latest
  73. steps:
  74. - uses: actions/checkout@v3
  75. - name: Set up environment
  76. uses: ./.github/actions/setup
  77. - run: rm foundry.toml
  78. - uses: crytic/slither-action@v0.3.0
  79. with:
  80. node-version: 18
  81. codespell:
  82. if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
  83. runs-on: ubuntu-latest
  84. steps:
  85. - uses: actions/checkout@v3
  86. - name: Run CodeSpell
  87. uses: codespell-project/actions-codespell@v1.0
  88. with:
  89. check_filenames: true
  90. skip: package-lock.json,*.pdf