ci.yaml 2.9 KB

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