如何使用travis CI配置颤振

问题描述 投票:4回答:1

我正在尝试使用travis-CI配置Flutter应用程序,但我找不到解决方法。

我使用以下代码尝试了.travis.yaml文件

  - linux
sudo: false
addons:
  apt:
    # Flutter depends on /usr/lib/x86_64-linux-gnu/libstdc++.so.6 version GLIBCXX_3.4.18
    sources:
      - ubuntu-toolchain-r-test # if we don't specify this, the libstdc++6 we get is the wrong version
    packages:
      - libstdc++6
      - fonts-droid-fallback
before_script:
  - git clone https://github.com/flutter/flutter.git -b beta
  - ./flutter/bin/flutter doctor
script:
  - ./flutter/bin/flutter test
cache:
  directories:
    - $HOME/.pub-cache

由于我是这个travis-CI的新手,您可以帮助我摆脱这个问题。

flutter travis-ci
1个回答
0
投票

我最近想出了一个解决方案,它正在工作,但是我仍然无法真正通过简单的集成测试来使其工作。我以某种方式必须在虚拟机中安装Android或iOS仿真器。 Flutter samples中有一些提示。

无论如何,这对我来说很简单:

env:
  - FLUTTER_GITHUB="https://github.com/flutter/flutter.git"

language: dart

dart:
  - stable

dart_task:
  - dartfmt

install:
  - git clone $FLUTTER_GITHUB -b stable

script:
  - ./flutter/bin/flutter doctor
  - ./flutter/bin/flutter test

您也可以将installscript替换为jobs工作流程:

jobs:
  include:
    - stage: Flutter Test
      language: dart
      os: linux
      install: git clone $FLUTTER_GITHUB -b stable
      before_script:
        - ./flutter/bin/flutter doctor
      script: 
        - ./flutter/bin/flutter test
© www.soinside.com 2019 - 2024. All rights reserved.