checks.yml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. changelog:
  14. if: github.event_name == 'pull_request' && github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
  15. runs-on: ubuntu-latest
  16. steps:
  17. - uses: actions/checkout@v3
  18. - name: Check diff
  19. run: |
  20. git fetch origin ${{ github.base_ref }} --depth=1
  21. if git diff --exit-code origin/${{ github.base_ref }} -- CHANGELOG.md ; then
  22. echo 'Missing changelog entry'
  23. exit 1
  24. fi
  25. lint:
  26. if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
  27. runs-on: ubuntu-latest
  28. steps:
  29. - uses: actions/checkout@v3
  30. - name: Set up environment
  31. uses: ./.github/actions/setup
  32. - run: npm run lint
  33. tests:
  34. runs-on: ubuntu-latest
  35. env:
  36. FORCE_COLOR: 1
  37. GAS: true
  38. steps:
  39. - uses: actions/checkout@v3
  40. - name: Set up environment
  41. uses: ./.github/actions/setup
  42. - name: Run tests and generate gas report
  43. run: npm run test
  44. - name: Check linearisation of the inheritance graph
  45. run: npm run test:inheritance
  46. - name: Check proceduraly generated contracts are up-to-date
  47. if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
  48. run: npm run test:generation
  49. - name: Compare gas costs
  50. uses: ./.github/actions/gas-compare
  51. with:
  52. token: ${{ github.token }}
  53. foundry-tests:
  54. runs-on: ubuntu-latest
  55. steps:
  56. - uses: actions/checkout@v3
  57. with:
  58. submodules: recursive
  59. - name: Install Foundry
  60. uses: foundry-rs/foundry-toolchain@v1
  61. with:
  62. version: nightly
  63. - name: Run tests
  64. run: forge test -vv
  65. coverage:
  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: npm run coverage
  73. env:
  74. NODE_OPTIONS: --max_old_space_size=4096
  75. - uses: codecov/codecov-action@v3
  76. slither:
  77. if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
  78. runs-on: ubuntu-latest
  79. steps:
  80. - uses: actions/checkout@v3
  81. - name: Set up environment
  82. uses: ./.github/actions/setup
  83. - uses: crytic/slither-action@v0.1.1
  84. codespell:
  85. if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
  86. runs-on: ubuntu-latest
  87. steps:
  88. - uses: actions/checkout@v3
  89. - name: Run CodeSpell
  90. uses: codespell-project/actions-codespell@v1.0
  91. with:
  92. check_filenames: true
  93. skip: package-lock.json