|
| 1 | +name: Smoke Tests |
| 2 | + |
| 3 | +on: [ pull_request ] |
| 4 | + |
| 5 | +jobs: |
| 6 | + smoke-tests: |
| 7 | + if: github.event.pull_request.head.repo.full_name == github.repository |
| 8 | + runs-on: ubuntu-latest |
| 9 | + steps: |
| 10 | + - uses: actions/checkout@v3 |
| 11 | + with: |
| 12 | + fetch-depth: 2 |
| 13 | + submodules: true |
| 14 | + - name: Set up JDK 11 |
| 15 | + uses: actions/setup-java@v2 |
| 16 | + with: |
| 17 | + java-version: 11 |
| 18 | + distribution: temurin |
| 19 | + cache: gradle |
| 20 | + - name: Set up NDK 21.4.7075529 |
| 21 | + run: | |
| 22 | + ANDROID_ROOT=/usr/local/lib/android |
| 23 | + ANDROID_SDK_ROOT=${ANDROID_ROOT}/sdk |
| 24 | + ANDROID_NDK_ROOT=${ANDROID_SDK_ROOT}/ndk-bundle |
| 25 | + SDKMANAGER=${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager |
| 26 | + echo "y" | $SDKMANAGER "ndk;21.4.7075529" |
| 27 | + ln -sfn ${ANDROID_SDK_ROOT}/ndk/21.4.7075529 ${ANDROID_NDK_ROOT} |
| 28 | + echo "ANDROID_NDK_HOME=${ANDROID_NDK_ROOT}" >> $GITHUB_ENV |
| 29 | + - uses: google-github-actions/auth@v0 |
| 30 | + with: |
| 31 | + credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT }} |
| 32 | + - uses: google-github-actions/setup-gcloud@v0 |
| 33 | + |
| 34 | + # TODO(yifany): make it a fireci plugin and remove the separately distributed jar file |
| 35 | + - name: Download smoke tests runner |
| 36 | + run: | |
| 37 | + SMOKE_TESTS_RUNNER_URL="https://storage.googleapis.com/android-ci/smoke-tests-runner.jar" |
| 38 | + curl ${SMOKE_TESTS_RUNNER_URL} --output runner.jar |
| 39 | +
|
| 40 | + # TODO(yifany): remove hardcoded reference to /smoke-tests-google-services from the runner |
| 41 | + - name: Add google-services.json |
| 42 | + env: |
| 43 | + SMOKE_TESTS_GOOGLE_SERVICES: ${{ secrets.SMOKE_TESTS_GOOGLE_SERVICES }} |
| 44 | + run: | |
| 45 | + echo $SMOKE_TESTS_GOOGLE_SERVICES | base64 -d > google-services.json |
| 46 | + sudo mkdir /smoke-tests-google-services |
| 47 | + sudo mv google-services.json /smoke-tests-google-services |
| 48 | +
|
| 49 | + # TODO(yifany): remove hardcoded reference to Prow environment variables from the runner |
| 50 | + - name: Run smoke tests |
| 51 | + env: |
| 52 | + FIREBASE_CI: 1 |
| 53 | + REPO_OWNER: ${{ github.repository_owner }} |
| 54 | + REPO_NAME: firebase-android-sdk |
| 55 | + PULL_NUMBER: ${{ github.event.pull_request.number }} |
| 56 | + JOB_NAME: smoke-tests |
| 57 | + BUILD_ID: ${{ github.run_id }} |
| 58 | + ARTIFACTS: ${{ runner.temp }} |
| 59 | + run: java -jar runner.jar smoke-tests/runner.config |
0 commit comments