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.

62 lines
1.4 KiB

3 years ago
3 years ago
  1. on:
  2. push:
  3. branches:
  4. - master
  5. pull_request:
  6. name: Tests
  7. jobs:
  8. tests:
  9. runs-on: ubuntu-latest
  10. steps:
  11. - name: Checkout sources
  12. uses: actions/checkout@v2
  13. - name: Install stable toolchain
  14. uses: actions-rs/toolchain@v1
  15. with:
  16. profile: minimal
  17. toolchain: stable
  18. override: true
  19. - name: Install node
  20. uses: actions/setup-node@v1
  21. with:
  22. node-version: 10
  23. - name: Install ganache
  24. run: npm install -g ganache-cli
  25. - name: Install Solc
  26. run: |
  27. mkdir -p "$HOME/bin"
  28. wget -q https://github.com/ethereum/solidity/releases/download/v0.7.6/solc-static-linux -O $HOME/bin/solc
  29. chmod u+x "$HOME/bin/solc"
  30. export PATH=$HOME/bin:$PATH
  31. solc --version
  32. - uses: Swatinem/rust-cache@v1
  33. with:
  34. cache-on-failure: true
  35. - name: cargo test
  36. run: |
  37. export PATH=$HOME/bin:$PATH
  38. cargo test
  39. lint:
  40. runs-on: ubuntu-latest
  41. steps:
  42. - name: Checkout sources
  43. uses: actions/checkout@v2
  44. - name: Install stable toolchain
  45. uses: actions-rs/toolchain@v1
  46. with:
  47. profile: minimal
  48. toolchain: stable
  49. override: true
  50. components: rustfmt, clippy
  51. - name: cargo fmt
  52. run: cargo fmt --all -- --check
  53. - name: cargo clippy
  54. run: cargo clippy -- -D warnings