ci.yaml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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.0'
  32. - name: Cache Cargo
  33. uses: actions/cache@v2
  34. with:
  35. path: |
  36. ~/.cargo
  37. key: ${{ runner.os }}-cargo-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
  38. - name: Cache Rust
  39. uses: actions/cache@v2
  40. with:
  41. path: |
  42. frontend/rust-lib/target
  43. shared-lib/target
  44. key: ${{ runner.os }}-rust-rust-lib-share-lib-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
  45. - name: Setup Environment
  46. run: |
  47. if [ "$RUNNER_OS" == "Linux" ]; then
  48. sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
  49. sudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list
  50. sudo apt-get update
  51. sudo apt-get install -y dart curl build-essential libsqlite3-dev libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev
  52. sudo apt-get install keybinder-3.0
  53. elif [ "$RUNNER_OS" == "macOS" ]; then
  54. echo 'do nothing'
  55. fi
  56. shell: bash
  57. - name: Deps
  58. working-directory: frontend
  59. run: |
  60. cargo install cargo-make
  61. cargo install duckscript_cli
  62. cargo make flowy_dev
  63. - name: Config Flutter
  64. run: |
  65. if [ "$RUNNER_OS" == "Linux" ]; then
  66. flutter config --enable-linux-desktop
  67. elif [ "$RUNNER_OS" == "macOS" ]; then
  68. flutter config --enable-macos-desktop
  69. fi
  70. shell: bash
  71. - name: Build
  72. working-directory: frontend
  73. run: |
  74. cargo make --profile ${{ matrix.flutter_profile }} appflowy-dev