ci.yaml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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
  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. elif [ "$RUNNER_OS" == "macOS" ]; then
  53. echo 'do nothing'
  54. fi
  55. shell: bash
  56. - name: Deps
  57. working-directory: frontend
  58. run: |
  59. cargo install cargo-make
  60. cargo install duckscript_cli
  61. cargo make flowy_dev
  62. - name: Config Flutter
  63. run: |
  64. if [ "$RUNNER_OS" == "Linux" ]; then
  65. flutter config --enable-linux-desktop
  66. elif [ "$RUNNER_OS" == "macOS" ]; then
  67. flutter config --enable-macos-desktop
  68. fi
  69. shell: bash
  70. - name: Build
  71. working-directory: frontend
  72. run: |
  73. cargo make --profile ${{ matrix.flutter_profile }} appflowy-dev