ci.yaml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. name: CI
  2. on:
  3. push:
  4. branches: [main]
  5. pull_request:
  6. branches: [main]
  7. jobs:
  8. rust-lint:
  9. runs-on: ubuntu-latest
  10. steps:
  11. - uses: actions/checkout@v1
  12. - id: component
  13. uses: actions-rs/components-nightly@v1
  14. with:
  15. component: clippy
  16. - uses: actions-rs/toolchain@v1
  17. with:
  18. toolchain: ${{ steps.component.outputs.toolchain }}
  19. override: true
  20. - run: rustup component add clippy
  21. working-directory: frontend/rust-lib
  22. - uses: actions-rs/clippy-check@v1
  23. with:
  24. token: ${{ secrets.GITHUB_TOKEN }}
  25. args: --all-features
  26. flutter-lint:
  27. name: flutter analyze
  28. runs-on: ubuntu-latest
  29. steps:
  30. - name: Checkout
  31. uses: actions/checkout@v2
  32. - uses: subosito/flutter-action@v1
  33. with:
  34. channel: "dev"
  35. - name: flutter pub get
  36. working-directory: frontend/app_flowy
  37. run: flutter pub get
  38. - name: flutter analyze
  39. working-directory: frontend/app_flowy
  40. run: flutter analyze
  41. sdk-tests:
  42. runs-on: ubuntu-latest
  43. steps:
  44. - name: Checkout
  45. uses: actions/checkout@v2
  46. - name: Install Rust
  47. run: |
  48. curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
  49. source $HOME/.cargo/env
  50. rustup toolchain install nightly
  51. rustup default nightly
  52. - name: Frontend tests
  53. working-directory: frontend/rust-lib
  54. run: cargo test
  55. - name: Shared-lib tests
  56. working-directory: shared-lib
  57. run: cargo test
  58. build-macos:
  59. runs-on: macOS-latest
  60. steps:
  61. - name: Checkout
  62. uses: actions/checkout@v2
  63. - name: Env install
  64. working-directory: frontend
  65. run: make install_rust
  66. - name: Checkou Flutter
  67. uses: actions/checkout@v2
  68. with:
  69. repository: flutter/flutter
  70. path: flutter
  71. - name: Flutter
  72. working-directory: flutter
  73. run: |
  74. echo "$(pwd)/bin" >> $GITHUB_PATH
  75. export PATH="$PATH:$(pwd)/bin"
  76. flutter channel dev
  77. flutter config --enable-macos-desktop
  78. flutter doctor
  79. - name: Deps
  80. working-directory: frontend
  81. run: |
  82. cargo install --force cargo-make
  83. cargo install --force duckscript_cli
  84. cargo make flowy_dev
  85. - name: Build
  86. working-directory: frontend
  87. run: cargo make --profile production-mac-x86 appflowy
  88. build-ubuntu:
  89. runs-on: ubuntu-latest
  90. steps:
  91. - name: Checkout
  92. uses: actions/checkout@v2
  93. - name: Packages
  94. run: |
  95. sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
  96. sudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list
  97. sudo apt-get update
  98. sudo apt-get install -y dart curl build-essential libsqlite3-dev libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev
  99. - name: Rust
  100. run: |
  101. curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
  102. source $HOME/.cargo/env
  103. rustup toolchain install nightly
  104. rustup default nightly
  105. - name: Flutter
  106. run: |
  107. git clone --depth 1 -b dev https://github.com/flutter/flutter.git
  108. cd flutter
  109. echo `pwd`"/bin" >> $GITHUB_PATH
  110. export PATH="$PATH:`pwd`/bin"
  111. flutter channel dev
  112. flutter config --enable-linux-desktop
  113. flutter doctor
  114. - name: Deps
  115. working-directory: frontend
  116. run: |
  117. cargo install --force cargo-make
  118. cargo install --force duckscript_cli
  119. cargo make flowy_dev
  120. - name: Build
  121. run: |
  122. cd frontend
  123. cargo make --profile production-linux-x86 appflowy