ci.yaml 2.9 KB

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