ci.yaml 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. sudo apt-get install keybinder-3.0
  54. elif [ "$RUNNER_OS" == "macOS" ]; then
  55. echo 'do nothing'
  56. fi
  57. shell: bash
  58. - if: steps.cache-cargo.outputs.cache-hit != 'true'
  59. name: Deps
  60. working-directory: frontend
  61. run: |
  62. cargo install cargo-make
  63. cargo install duckscript_cli
  64. - name: Cargo make flowy_dev
  65. working-directory: frontend
  66. run: |
  67. cargo make flowy_dev
  68. - name: Config Flutter
  69. run: |
  70. if [ "$RUNNER_OS" == "Linux" ]; then
  71. flutter config --enable-linux-desktop
  72. elif [ "$RUNNER_OS" == "macOS" ]; then
  73. flutter config --enable-macos-desktop
  74. fi
  75. shell: bash
  76. - name: Build
  77. working-directory: frontend
  78. run: |
  79. cargo make --profile ${{ matrix.flutter_profile }} appflowy-dev