use elvis operator to prevent null exception #477
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: treehouses remote build test | |
| on: | |
| push: | |
| branches: | |
| - '*' | |
| - '!master' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| ANDROID_NDK_VERSION: "21.3.6528147" | |
| BUILD_TOOLS_VERSION: "30.0.2" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: setup JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '17' | |
| cache: 'gradle' | |
| - name: install NDK | |
| run: | | |
| set -x | |
| echo "ANDROID_HOME is set to: ${ANDROID_HOME}" | |
| echo "ANDROID_SDK_ROOT is set to: ${ANDROID_SDK_ROOT}" | |
| echo "ANDROID_NDK_VERSION is set to: ${ANDROID_NDK_VERSION}" | |
| echo "y" | sudo ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --install "ndk;${ANDROID_NDK_VERSION}" --sdk_root=${ANDROID_SDK_ROOT} 2>&1 | |
| if [ $? -ne 0 ]; then | |
| echo "SDK Manager command failed" | |
| exit 1 | |
| fi | |
| set +x | |
| chmod +x ./gradlew | |
| - name: build debug as test | |
| run: ./gradlew assembleDebug |