Skip to content

Commit

Permalink
Remove NDK platforms dir check (#79)
Browse files Browse the repository at this point in the history
* Remove platforms dir check because it's missing from NDK r22+

* Add more E2E tests

* Restructure Bitrise workflows

* Fix broken React Native E2E test

* Fix broken E2E test

* Remove broken SDK20 E2E test

* Re-add old project test, but without Gradle step

* Use utility workflows for common logic

* Fix failing sample app build

* Fix another sample app build

[STEP-247]
  • Loading branch information
ofalvai authored Jul 27, 2021
1 parent 6ed845c commit e17ff54
Show file tree
Hide file tree
Showing 3 changed files with 187 additions and 339 deletions.
308 changes: 13 additions & 295 deletions bitrise.yml
Original file line number Diff line number Diff line change
@@ -1,131 +1,19 @@
format_version: "8"
format_version: "11"
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git

app:
envs:
# define these in your .bitrise.secrets.yml
- SAMPLE_APP_URL: https://github.com/bitrise-io/sample-apps-android-sdk22.git
- BRANCH: master

workflows:
# ----------------------------------------------------------------
# --- workflow to Step Test
test:
envs:
- GRADLE_BUILD_FILE_PATH: build.gradle
- GRADLEW_PATH: ./gradlew
check:
steps:
- script:
inputs:
- content: |-
#!/usr/bin/env bash
set -e
rm -rf ./_tmp
- change-workdir:
title: Switch working dir to test / _tmp dir
run_if: true
inputs:
- path: ./_tmp
- is_create_path: true
- git::https://github.com/bitrise-steplib/bitrise-step-simple-git-clone.git@master:
inputs:
- repository_url: $SAMPLE_APP_URL
- clone_into_dir: .
- branch: $BRANCH
- path::./:
title: Step test

ci:
steps:
- go-list:
- golint:
- errcheck:
- go-test:
before_run:
- audit-this-step
after_run:
- test_ndk
- test_old_gradle
- test_android-sdk21-tools-21.0.1
- test_android-sdk20
- test_android-sdk22-subdir
- test_react_native
- test_ndk_install
- test_support_library
- git::https://github.com/bitrise-steplib/steps-check.git: {}

test_ndk:
envs:
- SAMPLE_APP_URL: https://github.com/bitrise-io/android-ndk-sample-project.git
- BRANCH: ndk22-compatible
- GRADLE_BUILD_FILE_PATH: ./build.gradle
- GRADLEW_PATH: ./gradlew
- ANDROID_NDK_HOME: ""
e2e:
steps:
- script:
inputs:
- content: |-
#!/usr/bin/env bash
set -e
rm -rf ./_tmp
- change-workdir:
title: Switch working dir to test / _tmp dir
run_if: true
inputs:
- path: ./_tmp
- is_create_path: true
- git::https://github.com/bitrise-steplib/bitrise-step-simple-git-clone.git@master:
inputs:
- repository_url: $SAMPLE_APP_URL
- clone_into_dir: .
- branch: $BRANCH
- script:
- git::https://github.com/bitrise-steplib/steps-check.git:
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
rm -rf $ANDROID_HOME/ndk-bundle
- path::./:
title: Step test installing ndk
- path::./:
title: Step test installed ndk
- workflow: e2e

test_react_native:
sample:
envs:
- SAMPLE_APP_URL: https://github.com/bitrise-io/ChainReactApp.git
- BRANCH: master
- GRADLE_BUILD_FILE_PATH: android/build.gradle
- GRADLEW_PATH: android/gradlew
steps:
- script:
inputs:
- content: |-
#!/usr/bin/env bash
set -e
rm -rf ./_tmp
- change-workdir:
title: Switch working dir to test / _tmp dir
run_if: true
inputs:
- path: ./_tmp
- is_create_path: true
- git::https://github.com/bitrise-steplib/bitrise-step-simple-git-clone.git@master:
inputs:
- repository_url: $SAMPLE_APP_URL
- clone_into_dir: .
- branch: $BRANCH
- script:
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
yarn
- path::./:
title: Step test

test_ndk_install:
envs:
- SAMPLE_APP_URL: https://github.com/bitrise-io/android-ndk-sample-project.git
- BRANCH: ndk22-compatible
- GRADLE_BUILD_FILE_PATH: build.gradle
- GRADLEW_PATH: ./gradlew
steps:
Expand All @@ -137,187 +25,17 @@ workflows:
rm -rf ./_tmp
- change-workdir:
title: Switch working dir to test / _tmp dir
run_if: true
run_if: "true"
inputs:
- path: ./_tmp
- is_create_path: true
- git::https://github.com/bitrise-steplib/bitrise-step-simple-git-clone.git@master:
inputs:
- repository_url: $SAMPLE_APP_URL
- repository_url: https://github.com/bitrise-io/sample-apps-android-sdk22.git
- clone_into_dir: .
- branch: $BRANCH
- branch: master
- path::./:
title: Not using NDK
inputs:
- ndk_revision: ""
- path::./:
title: Installing NDK r18
inputs:
- ndk_revision: "18"
- path::./:
title: Already installed revision case
title: Execute step
- gradle-runner:
inputs:
- ndk_revision: "18"
- path::./:
title: Another version case
inputs:
- ndk_revision: "17"

test_android-sdk21-tools-21.0.1:
envs:
- SAMPLE_APP_URL: https://github.com/bitrise-io/android-sdk21-tools-21.0.1.git
- BRANCH: master
- GRADLE_BUILD_FILE_PATH: build.gradle
- GRADLEW_PATH: ./gradlew
steps:
- script:
inputs:
- content: |-
#!/usr/bin/env bash
set -e
rm -rf ./_tmp
- change-workdir:
title: Switch working dir to test / _tmp dir
run_if: true
inputs:
- path: ./_tmp
- is_create_path: true
- git::https://github.com/bitrise-steplib/bitrise-step-simple-git-clone.git@master:
inputs:
- repository_url: $SAMPLE_APP_URL
- clone_into_dir: .
- branch: $BRANCH
- path::./:
title: Step test

test_support_library:
envs:
- SAMPLE_APP_URL: https://github.com/bitrise-io/sample-apps-android-x.git
- BRANCH: master
- GRADLE_BUILD_FILE_PATH: build.gradle
- GRADLEW_PATH: ./gradlew
steps:
- script:
inputs:
- content: |-
#!/usr/bin/env bash
set -e
rm -rf ./_tmp
- script:
inputs:
- content: |-
#!/usr/bin/env bash
sdkmanager --uninstall "extras;android;m2repository"
- change-workdir:
title: Switch working dir to test / _tmp dir
run_if: true
inputs:
- path: ./_tmp
- is_create_path: true
- git::https://github.com/bitrise-steplib/bitrise-step-simple-git-clone.git@master:
inputs:
- repository_url: $SAMPLE_APP_URL
- clone_into_dir: .
- branch: $BRANCH
- path::./:
title: Step test

test_old_gradle:
envs:
- SAMPLE_APP_URL: https://github.com/bitrise-io/2048-android.git
- BRANCH: master
- GRADLE_BUILD_FILE_PATH: build.gradle
- GRADLEW_PATH: ./gradlew
steps:
- script:
inputs:
- content: |-
#!/usr/bin/env bash
set -e
rm -rf ./_tmp
- change-workdir:
title: Switch working dir to test / _tmp dir
run_if: true
inputs:
- path: ./_tmp
- is_create_path: true
- git::https://github.com/bitrise-steplib/bitrise-step-simple-git-clone.git@master:
inputs:
- repository_url: $SAMPLE_APP_URL
- clone_into_dir: .
- branch: $BRANCH
- path::./:
title: Step test

test_android-sdk20:
envs:
- SAMPLE_APP_URL: https://github.com/bitrise-io/sample-apps-android-sdk20.git
- BRANCH: master
- GRADLE_BUILD_FILE_PATH: build.gradle
- GRADLEW_PATH: ./gradlew
steps:
- script:
inputs:
- content: |-
#!/usr/bin/env bash
set -e
rm -rf ./_tmp
- change-workdir:
title: Switch working dir to test / _tmp dir
run_if: true
inputs:
- path: ./_tmp
- is_create_path: true
- git::https://github.com/bitrise-steplib/bitrise-step-simple-git-clone.git@master:
inputs:
- repository_url: $SAMPLE_APP_URL
- clone_into_dir: .
- branch: $BRANCH
- path::./:
title: Step test

test_android-sdk22-subdir:
envs:
- SAMPLE_APP_URL: https://github.com/bitrise-io/sample-apps-android-sdk22-subdir.git
- BRANCH: master
- GRADLE_BUILD_FILE_PATH: src/build.gradle
- GRADLEW_PATH: src/gradlew
steps:
- script:
inputs:
- content: |-
#!/usr/bin/env bash
set -e
rm -rf ./_tmp
- change-workdir:
title: Switch working dir to test / _tmp dir
run_if: true
inputs:
- path: ./_tmp
- is_create_path: true
- script:
inputs:
- content: |-
#!/usr/bin/env bash
if [[ -z "${SAMPLE_APP_URL}" ]]; then
echo "error: there is no SAMPLE_APP_URL env var specified"
exit 1
elif [[ -z "${COMMIT}" && -z "${BRANCH}" ]]; then
echo "error: can't checkout: there is no BRANCH or COMMIT env var specified"
exit 1
fi
git init
git remote add origin "${SAMPLE_APP_URL}"
git fetch || exit 1
[[ -n "${COMMIT}" ]] && git checkout "${COMMIT}" || git checkout "${BRANCH}"
- path::./:
title: Step test

audit-this-step:
steps:
- script:
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
stepman audit --step-yml ./step.yml
- gradle_task: assembleDebug
Loading

0 comments on commit e17ff54

Please sign in to comment.