【发布时间】:2022-03-12 02:22:04
【问题描述】:
我正在尝试在我的 github 存储库上实现持续集成。 如果项目与 root 处于同一级别,则它可以工作。但我想将项目放在一个文件夹中以使其井井有条。在我的本地设置中,我会执行“cd my_folder”,但我尝试将其添加到 .yml 脚本中,但仍然失败。
显示错误:
Error: No pubspec.yaml file found.
This command should be run from the root of your Flutter project.
Error: Process completed with exit code 1.
基本上它失败了,因为它试图在 pubspec.yaml 不存在的存储库的根目录中执行 pub get,而不是在文件夹内部。
这是代码:
on:
push:
branches:
- development
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: subosito/flutter-action@v1
with:
channel: 'beta'
# Enter into the flutter project.
- run: cd my_folder # Here I tried to put this command, but is useless
# Get flutter dependencies.
- run: flutter pub get # <--- Here is the error
# Statically analyze the Dart code for any errors.
- run: flutter analyze .
# Run widget tests for our flutter project.
- run: flutter test
【问题讨论】:
标签: flutter dart continuous-integration yaml continuous-deployment