ci.yaml 2.4 KB

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