-
Notifications
You must be signed in to change notification settings - Fork 620
Add workflow definition for smoke tests #3960
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
0efa743
smoke
yifanyang b6f88cb
workaround
yifanyang ecec82b
gcloud
yifanyang 1d6577a
show runner_temp
yifanyang 220c4eb
show artifacts
yifanyang 9653b0a
export
yifanyang 24936f6
sudo
yifanyang d309f55
test
yifanyang 6afbd0a
google-services
yifanyang 9894400
ndk
yifanyang 213dc4a
bla
yifanyang 647c134
workaround
yifanyang d88741a
mkdir
yifanyang 79f95ed
sudo
yifanyang 5911d95
workaround
yifanyang 20b401d
workaround
yifanyang 50a371c
env
yifanyang b88c878
debug
yifanyang ef062ed
pretent
yifanyang 3aacbea
test
yifanyang 2f1c276
run only if pull requests come from the same repo
yifanyang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Smoke Tests | ||
|
||
on: [ pull_request ] | ||
|
||
jobs: | ||
smoke-tests: | ||
if: github.event.pull_request.head.repo.full_name == github.repository | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 2 | ||
submodules: true | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: 11 | ||
distribution: temurin | ||
cache: gradle | ||
- name: Set up NDK 21.4.7075529 | ||
run: | | ||
ANDROID_ROOT=/usr/local/lib/android | ||
ANDROID_SDK_ROOT=${ANDROID_ROOT}/sdk | ||
ANDROID_NDK_ROOT=${ANDROID_SDK_ROOT}/ndk-bundle | ||
SDKMANAGER=${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager | ||
echo "y" | $SDKMANAGER "ndk;21.4.7075529" | ||
ln -sfn ${ANDROID_SDK_ROOT}/ndk/21.4.7075529 ${ANDROID_NDK_ROOT} | ||
echo "ANDROID_NDK_HOME=${ANDROID_NDK_ROOT}" >> $GITHUB_ENV | ||
- uses: google-github-actions/auth@v0 | ||
with: | ||
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT }} | ||
- uses: google-github-actions/setup-gcloud@v0 | ||
|
||
# TODO(yifany): make it a fireci plugin and remove the separately distributed jar file | ||
- name: Download smoke tests runner | ||
run: | | ||
SMOKE_TESTS_RUNNER_URL="https://storage.googleapis.com/android-ci/smoke-tests-runner.jar" | ||
curl ${SMOKE_TESTS_RUNNER_URL} --output runner.jar | ||
|
||
# TODO(yifany): remove hardcoded reference to /smoke-tests-google-services from the runner | ||
- name: Add google-services.json | ||
env: | ||
SMOKE_TESTS_GOOGLE_SERVICES: ${{ secrets.SMOKE_TESTS_GOOGLE_SERVICES }} | ||
run: | | ||
echo $SMOKE_TESTS_GOOGLE_SERVICES | base64 -d > google-services.json | ||
sudo mkdir /smoke-tests-google-services | ||
sudo mv google-services.json /smoke-tests-google-services | ||
|
||
# TODO(yifany): remove hardcoded reference to Prow environment variables from the runner | ||
- name: Run smoke tests | ||
env: | ||
FIREBASE_CI: 1 | ||
REPO_OWNER: ${{ github.repository_owner }} | ||
REPO_NAME: firebase-android-sdk | ||
PULL_NUMBER: ${{ github.event.pull_request.number }} | ||
JOB_NAME: smoke-tests | ||
BUILD_ID: ${{ github.run_id }} | ||
ARTIFACTS: ${{ runner.temp }} | ||
run: java -jar runner.jar smoke-tests/runner.config |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably worth adding a check to see if secrets are going to be available, similar to:
firebase-android-sdk/.github/workflows/ci_tests_experimental.yml
Lines 106 to 107 in 381bf87
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. The smoke tests were enabled only for presubmit on Prow, therefore it is set to trigger only on
pull_request
here, hence onlygithub.event.pull_request.head.repo.full_name == github.repository
.