Committed by
GitHub
Update github actions (#97)
* Don't run browser stack tests on PRs * add in cache for actions
正在显示
1 个修改的文件
包含
12 行增加
和
0 行删除
| @@ -25,6 +25,13 @@ jobs: | @@ -25,6 +25,13 @@ jobs: | ||
| 25 | java-version: '12' | 25 | java-version: '12' |
| 26 | distribution: 'adopt' | 26 | distribution: 'adopt' |
| 27 | 27 | ||
| 28 | + - uses: actions/cache@v2 | ||
| 29 | + with: | ||
| 30 | + path: | | ||
| 31 | + ~/.gradle/caches | ||
| 32 | + ~/.gradle/wrapper | ||
| 33 | + key: ${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | ||
| 34 | + | ||
| 28 | - name: Grant execute permission for gradlew | 35 | - name: Grant execute permission for gradlew |
| 29 | run: chmod +x gradlew | 36 | run: chmod +x gradlew |
| 30 | 37 | ||
| @@ -32,6 +39,7 @@ jobs: | @@ -32,6 +39,7 @@ jobs: | ||
| 32 | run: ./gradlew clean livekit-android-sdk:assembleRelease livekit-android-sdk:testRelease | 39 | run: ./gradlew clean livekit-android-sdk:assembleRelease livekit-android-sdk:testRelease |
| 33 | 40 | ||
| 34 | - name: Import video test keys into gradle properties | 41 | - name: Import video test keys into gradle properties |
| 42 | + if: github.event_name == 'push' | ||
| 35 | run: | | 43 | run: | |
| 36 | sed -i -e "s,livekitUrl=,livekitUrl=$LIVEKIT_URL,g" gradle.properties | 44 | sed -i -e "s,livekitUrl=,livekitUrl=$LIVEKIT_URL,g" gradle.properties |
| 37 | sed -i -e "s,livekitApiKey=,livekitApiKey=$LIVEKIT_API_KEY,g" gradle.properties | 45 | sed -i -e "s,livekitApiKey=,livekitApiKey=$LIVEKIT_API_KEY,g" gradle.properties |
| @@ -42,9 +50,11 @@ jobs: | @@ -42,9 +50,11 @@ jobs: | ||
| 42 | LIVEKIT_API_SECRET: ${{ secrets.LIVEKIT_API_SECRET }} | 50 | LIVEKIT_API_SECRET: ${{ secrets.LIVEKIT_API_SECRET }} |
| 43 | 51 | ||
| 44 | - name: Build video test app | 52 | - name: Build video test app |
| 53 | + if: github.event_name == 'push' | ||
| 45 | run: ./gradlew video-encode-decode-test:assembleDebug video-encode-decode-test:assembleDebugAndroidTest | 54 | run: ./gradlew video-encode-decode-test:assembleDebug video-encode-decode-test:assembleDebugAndroidTest |
| 46 | 55 | ||
| 47 | - name: Video Encode Decode App upload and Set app id in environment variable. | 56 | - name: Video Encode Decode App upload and Set app id in environment variable. |
| 57 | + if: github.event_name == 'push' | ||
| 48 | run: | | 58 | run: | |
| 49 | APP_UPLOAD_RESPONSE=$(curl -u "$BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY" -X POST https://api-cloud.browserstack.com/app-automate/upload -F "file=@video-encode-decode-test/build/outputs/apk/debug/video-encode-decode-test-debug.apk") | 59 | APP_UPLOAD_RESPONSE=$(curl -u "$BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY" -X POST https://api-cloud.browserstack.com/app-automate/upload -F "file=@video-encode-decode-test/build/outputs/apk/debug/video-encode-decode-test-debug.apk") |
| 50 | echo "APP_UPLOAD_RESPONSE: $APP_UPLOAD_RESPONSE" | 60 | echo "APP_UPLOAD_RESPONSE: $APP_UPLOAD_RESPONSE" |
| @@ -63,6 +73,7 @@ jobs: | @@ -63,6 +73,7 @@ jobs: | ||
| 63 | BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} | 73 | BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} |
| 64 | 74 | ||
| 65 | - name: Video Encode Decode Test Suite upload and Set test suite id in environment variable. | 75 | - name: Video Encode Decode Test Suite upload and Set test suite id in environment variable. |
| 76 | + if: github.event_name == 'push' | ||
| 66 | run: | | 77 | run: | |
| 67 | APP_UPLOAD_RESPONSE=$(curl -u "$BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY" -X POST https://api-cloud.browserstack.com/app-automate/espresso/v2/test-suite -F "file=@video-encode-decode-test/build/outputs/apk/androidTest/debug/video-encode-decode-test-debug-androidTest.apk") | 78 | APP_UPLOAD_RESPONSE=$(curl -u "$BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY" -X POST https://api-cloud.browserstack.com/app-automate/espresso/v2/test-suite -F "file=@video-encode-decode-test/build/outputs/apk/androidTest/debug/video-encode-decode-test-debug-androidTest.apk") |
| 68 | echo "APP_UPLOAD_RESPONSE: $APP_UPLOAD_RESPONSE" | 79 | echo "APP_UPLOAD_RESPONSE: $APP_UPLOAD_RESPONSE" |
| @@ -81,6 +92,7 @@ jobs: | @@ -81,6 +92,7 @@ jobs: | ||
| 81 | BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} | 92 | BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} |
| 82 | 93 | ||
| 83 | - name: Trigger BrowserStack tests | 94 | - name: Trigger BrowserStack tests |
| 95 | + if: github.event_name == 'push' | ||
| 84 | run: | | 96 | run: | |
| 85 | TEST_RESPONSE=$(curl -u "$BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY" -X POST "https://api-cloud.browserstack.com/app-automate/espresso/v2/build" -d '{"deviceLogs": true, "app": "'"$BROWSERSTACK_APP_ID"'", "testSuite": "'"$BROWSERSTACK_TEST_ID"'", "devices": ["Samsung Galaxy Tab S7-10.0","Samsung Galaxy S22-12.0", "Samsung Galaxy S21-12.0","Samsung Galaxy S20-10.0", "Google Pixel 6-12.0", "Google Pixel 5-11.0", "Google Pixel 3-10.0", "OnePlus 7-9.0","Xiaomi Redmi Note 8-9.0", "Huawei P30-9.0"]}' -H "Content-Type: application/json") | 97 | TEST_RESPONSE=$(curl -u "$BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY" -X POST "https://api-cloud.browserstack.com/app-automate/espresso/v2/build" -d '{"deviceLogs": true, "app": "'"$BROWSERSTACK_APP_ID"'", "testSuite": "'"$BROWSERSTACK_TEST_ID"'", "devices": ["Samsung Galaxy Tab S7-10.0","Samsung Galaxy S22-12.0", "Samsung Galaxy S21-12.0","Samsung Galaxy S20-10.0", "Google Pixel 6-12.0", "Google Pixel 5-11.0", "Google Pixel 3-10.0", "OnePlus 7-9.0","Xiaomi Redmi Note 8-9.0", "Huawei P30-9.0"]}' -H "Content-Type: application/json") |
| 86 | echo "TEST_RESPONSE: $TEST_RESPONSE" | 98 | echo "TEST_RESPONSE: $TEST_RESPONSE" |
-
请 注册 或 登录 后发表评论