ci.yaml 2.5 KB

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