rust_test.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. name: Unit test(Rust)
  2. on:
  3. push:
  4. branches:
  5. - 'main'
  6. pull_request:
  7. branches:
  8. - 'main'
  9. env:
  10. CARGO_TERM_COLOR: always
  11. jobs:
  12. tests:
  13. runs-on: ubuntu-latest
  14. steps:
  15. - name: Checkout
  16. uses: actions/checkout@v2
  17. - id: rust_toolchain
  18. uses: actions-rs/toolchain@v1
  19. with:
  20. toolchain: 'stable-2022-01-20'
  21. - name: Cache Cargo
  22. uses: actions/cache@v2
  23. with:
  24. path: |
  25. ~/.cargo
  26. key: ${{ runner.os }}-cargo-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
  27. - name: Cache Rust
  28. uses: actions/cache@v2
  29. with:
  30. path: |
  31. frontend/rust-lib/target
  32. shared-lib/target
  33. key: ${{ runner.os }}-rust-rust-lib-share-lib-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
  34. - name: Install cargo-make
  35. working-directory: frontend
  36. run: cargo install cargo-make
  37. - name: Run rust-lib tests
  38. working-directory: frontend/rust-lib
  39. run: RUST_LOG=info cargo test --no-default-features --features="sync"
  40. - name: Run shared-lib tests
  41. working-directory: shared-lib
  42. run: RUST_LOG=info cargo test --no-default-features