ci.yaml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. name: CI
  2. on:
  3. push:
  4. branches:
  5. - "main"
  6. pull_request:
  7. branches:
  8. - "main"
  9. jobs:
  10. build:
  11. strategy:
  12. matrix:
  13. os: [ubuntu-latest, macos-latest]
  14. include:
  15. - os: ubuntu-latest
  16. flutter_profile: development-linux-x86_64
  17. - os: macos-latest
  18. flutter_profile: development-mac-x86_64
  19. runs-on: ${{ matrix.os }}
  20. steps:
  21. - uses: actions/checkout@v2
  22. - id: rust_toolchain
  23. uses: actions-rs/toolchain@v1
  24. with:
  25. toolchain: "stable-2022-01-20"
  26. - id: flutter
  27. uses: subosito/flutter-action@v2
  28. with:
  29. channel: "stable"
  30. cache: true
  31. flutter-version: "3.0.5"
  32. - name: Cache Cargo
  33. id: cache-cargo
  34. uses: actions/cache@v2
  35. with:
  36. path: |
  37. ~/.cargo
  38. key: ${{ runner.os }}-cargo-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
  39. - name: Cache Rust
  40. uses: actions/cache@v2
  41. with:
  42. path: |
  43. frontend/rust-lib/target
  44. shared-lib/target
  45. key: ${{ runner.os }}-rust-rust-lib-share-lib-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
  46. - name: Setup Environment
  47. run: |
  48. if [ "$RUNNER_OS" == "Linux" ]; then
  49. sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
  50. sudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list
  51. sudo apt-get update
  52. sudo apt-get install -y dart curl build-essential libsqlite3-dev libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev
  53. elif [ "$RUNNER_OS" == "macOS" ]; then
  54. echo 'do nothing'
  55. fi
  56. shell: bash
  57. - if: steps.cache-cargo.outputs.cache-hit != 'true'
  58. name: Deps
  59. working-directory: frontend
  60. run: |
  61. cargo install cargo-make
  62. cargo install duckscript_cli
  63. - name: Cargo make flowy_dev
  64. working-directory: frontend
  65. run: |
  66. cargo make flowy_dev
  67. - name: Config Flutter
  68. run: |
  69. if [ "$RUNNER_OS" == "Linux" ]; then
  70. flutter config --enable-linux-desktop
  71. elif [ "$RUNNER_OS" == "macOS" ]; then
  72. flutter config --enable-macos-desktop
  73. fi
  74. shell: bash
  75. - name: Build
  76. working-directory: frontend
  77. run: |
  78. cargo make --profile ${{ matrix.flutter_profile }} appflowy-dev