You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
1.9 KiB

2 years ago
  1. name: Build
  2. on:
  3. push:
  4. branches:
  5. - main
  6. pull_request:
  7. branches:
  8. - main
  9. schedule:
  10. - cron: '0 0 * * 1'
  11. workflow_dispatch:
  12. jobs:
  13. build:
  14. runs-on: ubuntu-latest
  15. steps:
  16. - name: Cancel Outdated Builds
  17. uses: styfle/cancel-workflow-action@0.9.1
  18. with:
  19. all_but_latest: true
  20. access_token: ${{ github.token }}
  21. - name: Checkout Repository
  22. uses: actions/checkout@v3
  23. - name: Install stable toolchain
  24. uses: actions-rs/toolchain@v1
  25. with:
  26. profile: default
  27. toolchain: stable
  28. override: true
  29. default: true
  30. components: rustfmt, clippy
  31. - name: Install stable toolchain
  32. uses: actions-rs/toolchain@v1
  33. with:
  34. profile: minimal
  35. toolchain: nightly
  36. override: false
  37. default: false
  38. components: rustfmt
  39. - uses: Swatinem/rust-cache@v1
  40. name: Enable Rust Caching
  41. - name: Format Check
  42. run: cargo +nightly fmt -- --check
  43. - name: Clippy
  44. uses: actions-rs/clippy-check@v1
  45. with:
  46. token: ${{ github.token }}
  47. - name: Audit
  48. uses: actions-rs/audit-check@v1
  49. with:
  50. token: ${{ github.token }}
  51. - name: Check Bench
  52. run: cargo bench --no-run
  53. - name: Check Ignored Tests
  54. run: cargo test --no-run -- --ignored
  55. - name: Test
  56. run: bash ./scripts/run_tests.sh
  57. - name: Generate Documentation
  58. run: |
  59. cargo doc --no-deps --lib --release
  60. cp -R target/doc public
  61. echo '<meta http-equiv="refresh" content="0; url=jf_plonk">' > public/index.html
  62. - name: Deploy
  63. uses: peaceiris/actions-gh-pages@v3
  64. if: ${{ github.ref == 'refs/heads/main' }}
  65. with:
  66. github_token: ${{ secrets.GITHUB_TOKEN }}
  67. publish_dir: ./public
  68. cname: hyperplonk.docs.espressosys.com