mirror of
https://github.com/flutter/samples.git
synced 2025-11-10 23:08:59 +00:00
Sharding travis jobs (#239)
This commit is contained in:
33
.travis.yml
33
.travis.yml
@@ -1,7 +1,5 @@
|
|||||||
os:
|
os: linux
|
||||||
- linux
|
|
||||||
dist: trusty
|
dist: trusty
|
||||||
language: android
|
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
@@ -19,21 +17,31 @@ android:
|
|||||||
- build-tools-28.0.3
|
- build-tools-28.0.3
|
||||||
- android-28
|
- android-28
|
||||||
|
|
||||||
env:
|
|
||||||
- FLUTTER_VERSION=stable
|
|
||||||
- FLUTTER_VERSION=beta
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
include:
|
||||||
|
- name: "Android tests, stable channel"
|
||||||
|
language: android
|
||||||
|
script: ./tool/travis_android_script.sh
|
||||||
|
env: FLUTTER_VERSION=stable
|
||||||
|
- name: "Flutter tests, stable channel"
|
||||||
|
language: ruby
|
||||||
|
script: ./tool/travis_flutter_script.sh
|
||||||
|
env: FLUTTER_VERSION=stable
|
||||||
|
- name: "Android tests, beta channel"
|
||||||
|
language: android
|
||||||
|
script: ./tool/travis_android_script.sh
|
||||||
|
env: FLUTTER_VERSION=beta
|
||||||
|
- name: "Flutter tests, beta channel"
|
||||||
|
language: ruby
|
||||||
|
script: ./tool/travis_flutter_script.sh
|
||||||
|
env: FLUTTER_VERSION=beta
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- env: FLUTTER_VERSION=beta
|
- env: FLUTTER_VERSION=beta
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- git clone https://github.com/flutter/flutter.git -b $FLUTTER_VERSION
|
- git clone https://github.com/flutter/flutter.git -b $FLUTTER_VERSION
|
||||||
- ./flutter/bin/flutter doctor
|
- ./flutter/bin/flutter doctor
|
||||||
- chmod +x travis_script.sh
|
- chmod +x tool/travis_*_script.sh
|
||||||
|
|
||||||
script:
|
|
||||||
- ./travis_script.sh
|
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
@@ -43,6 +51,7 @@ notifications:
|
|||||||
email:
|
email:
|
||||||
brogdon+github@gmail.com
|
brogdon+github@gmail.com
|
||||||
|
|
||||||
# Only building master means that we don't run two builds for each pull request.
|
# Building master alone means that we don't run two builds for
|
||||||
|
# each pull request.
|
||||||
branches:
|
branches:
|
||||||
only: [master]
|
only: [master]
|
||||||
|
|||||||
56
tool/travis_android_script.sh
Executable file
56
tool/travis_android_script.sh
Executable file
@@ -0,0 +1,56 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Backs up one directory at a time, looking for one called "flutter". Once it
|
||||||
|
# finds that directory, an absolute path to it is returned.
|
||||||
|
function getFlutterPath() {
|
||||||
|
local path=""
|
||||||
|
local counter=0
|
||||||
|
|
||||||
|
while [[ "${counter}" -lt 10 ]]; do
|
||||||
|
[ -d "${path}flutter" ] && echo "$(pwd)/${path}flutter" && return 0
|
||||||
|
let counter++
|
||||||
|
path="${path}../"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
localSdkPath=$(getFlutterPath)
|
||||||
|
|
||||||
|
if [ -z "$localSdkPath" ]
|
||||||
|
then
|
||||||
|
echo "Failed to find the Flutter SDK!."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Flutter SDK found at ${localSdkPath}"
|
||||||
|
|
||||||
|
echo "Fetching dependencies and building 'flutter_module'."
|
||||||
|
pushd add_to_app/flutter_module
|
||||||
|
"${localSdkPath}/bin/flutter" packages get
|
||||||
|
"${localSdkPath}/bin/flutter" build aar
|
||||||
|
popd
|
||||||
|
|
||||||
|
echo "Fetching dependencies for 'flutter_module_using_plugin'."
|
||||||
|
pushd add_to_app/flutter_module_using_plugin
|
||||||
|
"${localSdkPath}/bin/flutter" packages get
|
||||||
|
popd
|
||||||
|
|
||||||
|
declare -a ANDROID_PROJECT_NAMES=(
|
||||||
|
"add_to_app/android_fullscreen" \
|
||||||
|
"add_to_app/android_using_plugin" \
|
||||||
|
"add_to_app/android_using_prebuilt_module" \
|
||||||
|
)
|
||||||
|
|
||||||
|
for PROJECT_NAME in "${ANDROID_PROJECT_NAMES[@]}"
|
||||||
|
do
|
||||||
|
echo "== Testing '${PROJECT_NAME}' on Flutter's $FLUTTER_VERSION channel =="
|
||||||
|
pushd "${PROJECT_NAME}"
|
||||||
|
|
||||||
|
./gradlew --stacktrace assembleDebug
|
||||||
|
./gradlew --stacktrace assembleRelease
|
||||||
|
|
||||||
|
popd
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "-- Success --"
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Backs up one directory at a time, looking for one called "flutter". Once it
|
# Backs up one directory at a time, looking for one called "flutter". Once it
|
||||||
@@ -57,31 +59,11 @@ do
|
|||||||
popd
|
popd
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Test that the code segment widgets that get displayed in the Flutter Material
|
||||||
|
# gallery have been generated using the latest gallery code.
|
||||||
echo "Run code segments check for 'gallery/gallery'."
|
echo "Run code segments check for 'gallery/gallery'."
|
||||||
pushd gallery/gallery
|
pushd gallery/gallery
|
||||||
"${localSdkPath}/bin/flutter" pub run grinder verify-code-segments
|
"${localSdkPath}/bin/flutter" pub run grinder verify-code-segments
|
||||||
popd
|
popd
|
||||||
|
|
||||||
echo "Building the aar files for 'flutter_module'."
|
|
||||||
pushd add_to_app/flutter_module
|
|
||||||
"${localSdkPath}/bin/flutter" build aar
|
|
||||||
popd
|
|
||||||
|
|
||||||
declare -a ANDROID_PROJECT_NAMES=(
|
|
||||||
"add_to_app/android_fullscreen" \
|
|
||||||
"add_to_app/android_using_plugin" \
|
|
||||||
"add_to_app/android_using_prebuilt_module" \
|
|
||||||
)
|
|
||||||
|
|
||||||
for PROJECT_NAME in "${ANDROID_PROJECT_NAMES[@]}"
|
|
||||||
do
|
|
||||||
echo "== Testing '${PROJECT_NAME}' on Flutter's $FLUTTER_VERSION channel =="
|
|
||||||
pushd "${PROJECT_NAME}"
|
|
||||||
|
|
||||||
./gradlew assembleDebug
|
|
||||||
./gradlew assembleRelease
|
|
||||||
|
|
||||||
popd
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "-- Success --"
|
echo "-- Success --"
|
||||||
Reference in New Issue
Block a user