ci.yaml 3.8 KB

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