iPhone XR 15 Palace #36
This file contains 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: iPhone XR 15 Palace | |
on: | |
schedule: | |
- cron: '00 15 * * 3' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check disk space before operations | |
run: | | |
echo "Checking disk space before operations" | |
df -h | |
- name: Cleanup before operations | |
run: | | |
echo "Cleaning up any previous builds and artifacts" | |
rm -rf *.zip | |
rm -rf *.ipa | |
rm -rf *_diag | |
- uses: actions/checkout@v4 | |
- name: Upload to browserstack and trigger tests | |
run: | | |
COMMITS=$(curl -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/ThePalaceProject/ios-binaries/commits?per_page=50&page=1") | |
URLS=$(echo $COMMITS | jq -r '.[] | select(.commit.author.name=="runner")' | jq -r '.url') | |
URL=${URLS:0:107} | |
echo URL: $URL | |
RESPONSE=$(curl -H "Accept: application/vnd.github.v3+json" $URL) | |
readarray -t build_name <<<"$(jq '.files[].filename'<<<$RESPONSE)" | |
ZIP_NAME=${build_name:1:21} | |
unzip $ZIP_NAME | |
fileName=*.ipa | |
echo file: $fileName | |
BUILD_NAME=$fileName | |
echo buildName: $BUILD_NAME | |
fileName_abs_path=$(realpath $fileName) | |
APP_UPLOAD_RESPONSE=$(curl -u "${{ secrets.BROWSERSTACK_USERNAME }}:${{ secrets.BROWSERSTACK_ACCESSKEY }}" -X POST "https://api-cloud.browserstack.com/app-automate/upload" -F "file=@$fileName_abs_path") | |
APP_ID=$(echo $APP_UPLOAD_RESPONSE | jq -r ".app_url") | |
echo APP_ID: $APP_ID | |
echo "Triggering autotests" | |
curl -X POST -H "Accept:application/vnd.github.v3+json" https://api.github.com/repos/ThePalaceProject/mobile-integration-tests-new/actions/workflows/maven.yml/dispatches -d '{"ref":"main", "inputs":{"test_tag":"@tier2","build_name":"'"$BUILD_NAME"'","device_name_and_version":"iPhoneXR_15","bs_app_link":"'"$APP_ID"'","platform_name":"ios"}}' -H "Authorization: token ${{secrets.PERSONAL_TOKEN}}" | |
- name: Cleanup after operations | |
run: | | |
echo "Cleaning up builds and artifacts after operations" | |
rm -rf *.zip | |
rm -rf *.ipa | |
- name: Check disk space after cleanup | |
run: | | |
echo "Checking disk space after cleanup" | |
df -h |