crate-check.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. name: crate-check
  2. on:
  3. push:
  4. branches:
  5. - master
  6. pull_request:
  7. branches:
  8. - master
  9. paths:
  10. - "**/Cargo.toml"
  11. - ".github/workflows/crate-check.yml"
  12. - "./ci/check-crates.sh"
  13. jobs:
  14. check:
  15. name: crate check
  16. if: github.repository == 'anza-xyz/agave'
  17. runs-on: ubuntu-22.04
  18. steps:
  19. - uses: actions/checkout@v6
  20. with:
  21. fetch-depth: 0
  22. - name: Get commit range (push)
  23. if: ${{ github.event_name == 'push' }}
  24. run: |
  25. echo "COMMIT_RANGE=${{ github.event.before }}..$GITHUB_SHA" >> $GITHUB_ENV
  26. - name: Get commit range (pull_request)
  27. if: ${{ github.event_name == 'pull_request' }}
  28. run: |
  29. echo "COMMIT_RANGE=${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
  30. - name: Setup Rust
  31. shell: bash
  32. run: |
  33. source ci/rust-version.sh stable
  34. rustup default $rust_stable
  35. - name: Install toml-cli
  36. shell: bash
  37. run: |
  38. cargo install toml-cli
  39. - run: |
  40. ci/check-crates.sh
  41. error_reporting:
  42. needs:
  43. - check
  44. if: failure() && github.event_name == 'push'
  45. uses: ./.github/workflows/error-reporting.yml
  46. secrets:
  47. WEBHOOK: ${{ secrets.SLACK_ERROR_REPORTING_WEBHOOK }}