您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

ci.yml 3.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. name: CI
  2. env:
  3. CARGO_TERM_COLOR: always
  4. REGISTRY: ghcr.io
  5. on:
  6. push:
  7. branches:
  8. - develop
  9. pull_request:
  10. types: [opened, reopened, edited, synchronize]
  11. branches:
  12. - develop
  13. jobs:
  14. fmt:
  15. name: fmt
  16. runs-on: ubuntu-latest
  17. steps:
  18. - uses: actions/checkout@v3
  19. - name: Install Rust Toolchain
  20. uses: actions-rs/toolchain@v1
  21. with:
  22. toolchain: nightly
  23. components: rustfmt
  24. - name: cargo fmt
  25. run: cargo +nightly fmt -- --check
  26. clippy:
  27. name: clippy
  28. needs: fmt
  29. runs-on: ubuntu-latest
  30. steps:
  31. - uses: actions/checkout@v3
  32. - name: Install Rust Toolchain
  33. uses: actions-rs/toolchain@v1
  34. with:
  35. toolchain: nightly
  36. components: clippy
  37. - name: cargo clippy
  38. run: cargo +nightly clippy --workspace --tests -- -D warnings
  39. tests:
  40. name: tests
  41. needs: [clippy, fmt]
  42. runs-on: ubuntu-latest
  43. steps:
  44. - uses: actions/checkout@v3
  45. - name: Install Rust Toolchain
  46. uses: actions-rs/toolchain@v1
  47. with:
  48. toolchain: stable
  49. - name: Run tests for [common-api]
  50. run: cargo test --tests --all-features
  51. tests-web:
  52. name: tests-web
  53. needs: [clippy, fmt]
  54. runs-on: ubuntu-latest
  55. permissions:
  56. packages: read
  57. steps:
  58. - name: Log in to the Container registry
  59. uses: docker/login-action@v2.0.0
  60. with:
  61. registry: ${{ env.REGISTRY }}
  62. username: ${{ github.actor }}
  63. password: ${{ secrets.GITHUB_TOKEN }}
  64. - name: Setup ssh access for a private repositories
  65. uses: webfactory/ssh-agent@v0.7.0
  66. with:
  67. ssh-private-key: |
  68. ${{ secrets.CLIENT_SSH_PRIVATE_KEY }}
  69. ${{ secrets.KEYEXCHANGE_SSH_PRIVATE_KEY }}
  70. ${{ secrets.SMARTCONTRACTS_SSH_PRIVATE_KEY }}
  71. - name: Clone key-exchange-server and deploy
  72. run: |
  73. docker pull ${{ env.REGISTRY }}/relayz-io/key-exchange:latest
  74. docker tag ${{ env.REGISTRY }}/relayz-io/key-exchange:latest key-exchange:latest
  75. git clone git@github.com:Relayz-io/key-exchange-server.git
  76. (cd key-exchange-server && docker compose up -d --no-build)
  77. - name: Clone near-smartcontracts and deploy
  78. run: |
  79. docker pull ${{ env.REGISTRY }}/relayz-io/sandbox:latest
  80. docker tag ${{ env.REGISTRY }}/relayz-io/sandbox:latest sandbox:latest
  81. docker pull ${{ env.REGISTRY }}/relayz-io/sandbox-artifact:latest
  82. docker tag ${{ env.REGISTRY }}/relayz-io/sandbox-artifact:latest sandbox-artifact:latest
  83. docker pull ${{ env.REGISTRY }}/relayz-io/contract-artifact:latest
  84. docker tag ${{ env.REGISTRY }}/relayz-io/contract-artifact:latest contract-artifact:latest
  85. git clone git@github.com:Relayz-io/near-smartcontracts.git
  86. (cd near-smartcontracts && docker compose -f docker-compose.yml -f docker-compose.tests.yml up -d --no-build)
  87. - uses: actions/checkout@v3
  88. - name: Run tests for [web]
  89. run: docker compose up --abort-on-container-exit