iPhone SE 2020 16 Lyrasis #48
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 SE 2020 16 Lyrasis | |
on: | |
schedule: | |
- cron: '30 20 * * 4' | |
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) | |
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":"@tier1","build_name":"'"$BUILD_NAME"'","device_name_and_version":"iPhoneSE2020_16","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 |