Merge pull request #387 from hanabi1224/cirrus_ci

cirrus ci
This commit is contained in:
hanxu317317
2019-11-08 14:38:52 +08:00
committed by GitHub
2 changed files with 62 additions and 0 deletions

30
.ci/Dockerfile Normal file
View File

@ -0,0 +1,30 @@
FROM cirrusci/flutter:stable
RUN sudo apt-get update -y
RUN sudo apt-get install -y --no-install-recommends gnupg
# Add repo for gcloud sdk and install it
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | \
sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | \
sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
RUN sudo apt-get update && sudo apt-get install -y google-cloud-sdk && \
gcloud config set core/disable_usage_reporting true && \
gcloud config set component_manager/disable_update_check true
RUN yes | sdkmanager \
"platforms;android-29" \
"build-tools;29.0.2" \
"extras;google;m2repository" \
"extras;android;m2repository"
RUN yes | sdkmanager \
"platforms;android-28" \
"build-tools;28.0.3" \
"extras;google;m2repository" \
"extras;android;m2repository"
RUN yes | sdkmanager --licenses

32
.cirrus.yml Normal file
View File

@ -0,0 +1,32 @@
task:
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true' && $CIRRUS_PR == ''
container:
dockerfile: .ci/Dockerfile
cpu: 8
memory: 16G
pub_cache:
folder: ~/.pub-cache
setup_script:
- flutter channel stable
- flutter upgrade
build_script:
- flutter build apk
test_script: flutter test
task:
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'
osx_instance:
#image: mojave-xcode-10.2-flutter
image: mojave-flutter
pub_cache:
folder: ~/.pub-cache
setup_script:
- pod repo update
- flutter channel stable
- flutter upgrade
create_simulator_script:
- xcrun simctl list
- xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-X com.apple.CoreSimulator.SimRuntime.iOS-12-2 | xargs xcrun simctl boot
build_script:
- flutter build ios --no-codesign
test_script: flutter test