mirror of
https://github.com/gmeligio/flutter-docker-image.git
synced 2026-05-24 12:30:34 +00:00
test: add test commands for downloads
This commit is contained in:
@@ -120,11 +120,11 @@ jobs:
|
||||
android_build_tools_version=${{ env.ANDROID_BUILD_TOOLS_VERSION }}
|
||||
android_platform_versions=${{ env.ANDROID_PLATFORM_VERSIONS }}
|
||||
|
||||
- name: Test image structure
|
||||
- name: Test image
|
||||
uses: plexsystems/container-structure-test-action@v0.3.0
|
||||
with:
|
||||
image: ${{ fromJSON(steps.metadata.outputs.json).tags[0] }}
|
||||
config: test/android_sdk_structure.yml
|
||||
config: test/android.yml
|
||||
|
||||
# - name: Test Android bundle
|
||||
# uses: docker/build-push-action@v4
|
||||
|
||||
-16
@@ -187,19 +187,3 @@ RUN mkdir -p "$ANDROID_HOME" \
|
||||
&& ./gradlew --version \
|
||||
&& cd ../.. \
|
||||
&& rm -r build_app
|
||||
|
||||
FROM android as bundle-test
|
||||
|
||||
USER flutter:flutter
|
||||
WORKDIR "$HOME"
|
||||
|
||||
SHELL ["/bin/bash", "-euxo", "pipefail", "-c"]
|
||||
|
||||
RUN flutter create test_app
|
||||
|
||||
WORKDIR "$HOME/test_app/android"
|
||||
RUN ./gradlew assembleRelease \
|
||||
&& ./gradlew bundleRelease
|
||||
|
||||
WORKDIR "$HOME/test_app"
|
||||
RUN flutter build appbundle
|
||||
|
||||
@@ -29,15 +29,3 @@ services:
|
||||
android_platform_versions: $ANDROID_PLATFORM_VERSIONS
|
||||
environment:
|
||||
ENABLE_ANALYTICS: $ENABLE_ANALYTICS
|
||||
|
||||
bundle-test:
|
||||
build:
|
||||
context: .
|
||||
target: bundle-test
|
||||
args:
|
||||
flutter_version: $FLUTTER_VERSION
|
||||
android_build_tools_version: $ANDROID_BUILD_TOOLS_VERSION
|
||||
android_platform_versions: $ANDROID_PLATFORM_VERSIONS
|
||||
environment:
|
||||
ENABLE_ANALYTICS: $ENABLE_ANALYTICS
|
||||
working_dir: /home/flutter/test_app/android
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
container-structure-test test --image gcr.io/registry/image:latest \
|
||||
--config config.yaml
|
||||
container-structure-test test --image flutter-docker-image-android --config test/android.yml
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
schemaVersion: 2.0.0
|
||||
commandTests:
|
||||
- name: "Android SDK build tools is version 30.0.3"
|
||||
command: "ls"
|
||||
args: ["/home/flutter/sdks/android-sdk/build-tools"]
|
||||
expectedOutput: ["30.0.3"]
|
||||
- name: "Android SDK build tools directory only has one directory"
|
||||
command: "bash"
|
||||
args:
|
||||
- -c
|
||||
- |
|
||||
ls /home/flutter/sdks/android-sdk/build-tools \
|
||||
| wc -l
|
||||
- name: "Gradle, licenses and platforms are already downloaded"
|
||||
setup: [["flutter", "create", "test_app"]]
|
||||
teardown: [["rm", "-r", "test_app"]]
|
||||
command: "bash"
|
||||
args:
|
||||
- "-c"
|
||||
- |
|
||||
cd test_app/android \
|
||||
&& timeout --preserve-status 180s ./gradlew bundleRelease
|
||||
excludedOutput:
|
||||
- 'Downloading https:\/\/services\.gradle\.org\/distributions\/gradle-\d\.\d-.{1,3}\.zip'
|
||||
- 'Checking the license'
|
||||
- 'Installing Android SDK Platform'
|
||||
- 'Downloading'
|
||||
|
||||
fileContentTests:
|
||||
- name: 'Android SDK Command-line Tools is version 9.0'
|
||||
path: '/home/flutter/sdks/android-sdk/cmdline-tools/latest/source.properties'
|
||||
expectedContents: ['Pkg.Revision=9.0\nPkg.Path=cmdline-tools;9.0\nPkg.Desc=Android SDK Command-line Tools']
|
||||
@@ -1,16 +0,0 @@
|
||||
schemaVersion: 2.0.0
|
||||
commandTests:
|
||||
- name: "Android SDK build tools is version 30.0.3"
|
||||
command: "ls"
|
||||
args: ["/home/flutter/sdks/android-sdk/build-tools"]
|
||||
expectedOutput: ["30.0.3"]
|
||||
- name: "Android SDK build tools directory only has one directory"
|
||||
command: "bash"
|
||||
args:
|
||||
- -c
|
||||
- |
|
||||
ls /home/flutter/sdks/android-sdk/build-tools | wc -l
|
||||
fileContentTests:
|
||||
- name: 'Android SDK Command-line Tools is version 9.0'
|
||||
path: '/home/flutter/sdks/android-sdk/cmdline-tools/latest/source.properties'
|
||||
expectedContents: ['Pkg.Revision=9.0\nPkg.Path=cmdline-tools;9.0\nPkg.Desc=Android SDK Command-line Tools']
|
||||
Reference in New Issue
Block a user