Skip to content

Commit 560e612

Browse files
committed
Revert change
1 parent 750afbe commit 560e612

File tree

1 file changed

+124
-0
lines changed

1 file changed

+124
-0
lines changed

.github/workflows/daily.yml

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
name: Daily Jobs
2+
3+
on:
4+
schedule:
5+
- cron: '0 12 * * *'
6+
workflow_dispatch:
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
NIGHTLY_TOOLCHAIN: nightly
11+
12+
jobs:
13+
build-for-iOS:
14+
runs-on: macos-latest
15+
timeout-minutes: 30
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- uses: dtolnay/rust-toolchain@stable
20+
21+
- name: Add iOS targets
22+
run: rustup target add aarch64-apple-ios x86_64-apple-ios
23+
24+
- name: Build app for iOS
25+
run: |
26+
cd examples/mobile
27+
make xcodebuild-iphone
28+
mkdir Payload
29+
mv build/Build/Products/Debug-iphoneos/bevy_mobile_example.app Payload
30+
zip -r bevy_mobile_example.zip Payload
31+
mv bevy_mobile_example.zip bevy_mobile_example.ipa
32+
33+
- name: Upload to Browser Stack
34+
run: |
35+
curl -u "${{ secrets.BROWSERSTACK_USERNAME }}:${{ secrets.BROWSERSTACK_ACCESS_KEY }}" \
36+
-X POST "https://api-cloud.browserstack.com/app-automate/upload" \
37+
-F "file=@examples/mobile/bevy_mobile_example.ipa" \
38+
-F "custom_id=$GITHUB_RUN_ID"
39+
40+
build-for-Android:
41+
runs-on: ubuntu-latest
42+
timeout-minutes: 30
43+
steps:
44+
- uses: actions/checkout@v3
45+
46+
- uses: dtolnay/rust-toolchain@stable
47+
48+
- name: Add Android targets
49+
run: rustup target add aarch64-linux-android armv7-linux-androideabi
50+
51+
- name: Install Cargo APK
52+
run: cargo install --force cargo-apk
53+
54+
- name: Build app for Android
55+
run: ANDROID_NDK_ROOT=$ANDROID_NDK_LATEST_HOME cargo apk build --package bevy_mobile_example
56+
env:
57+
# This will reduce the APK size from 1GB to ~200MB
58+
CARGO_PROFILE_DEV_DEBUG: false
59+
60+
- name: Upload to Browser Stack
61+
run: |
62+
curl -u "${{ secrets.BROWSERSTACK_USERNAME }}:${{ secrets.BROWSERSTACK_ACCESS_KEY }}" \
63+
-X POST "https://api-cloud.browserstack.com/app-automate/upload" \
64+
-F "file=@target/debug/apk/bevyexample.apk" \
65+
-F "custom_id=$GITHUB_RUN_ID"
66+
67+
nonce:
68+
runs-on: ubuntu-latest
69+
timeout-minutes: 30
70+
outputs:
71+
result: ${{ steps.nonce.outputs.result }}
72+
steps:
73+
- id: nonce
74+
run: echo "result=${{ github.run_id }}-$(date +%s)" >> $GITHUB_OUTPUT
75+
76+
run:
77+
runs-on: ubuntu-latest
78+
timeout-minutes: 30
79+
needs: [nonce, build-for-iOS, build-for-Android]
80+
env:
81+
PERCY_PARALLEL_NONCE: ${{ needs.nonce.outputs.result }}
82+
PERCY_PARALLEL_TOTAL: ${{ strategy.job-total }}
83+
strategy:
84+
matrix:
85+
include:
86+
- device: "iPhone 13"
87+
os_version: "15"
88+
- device: "Samsung Galaxy S23"
89+
os_version: "13.0"
90+
steps:
91+
- uses: actions/checkout@v3
92+
93+
- name: Run Example
94+
run: |
95+
cd .github/start-mobile-example
96+
npm install
97+
npm install -g @percy/cli@latest
98+
npx percy app:exec --parallel -- npm run mobile
99+
env:
100+
BROWSERSTACK_APP_ID: ${{ github.run_id }}
101+
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
102+
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
103+
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
104+
DEVICE: ${{ matrix.device }}
105+
OS_VERSION: ${{ matrix.os_version }}
106+
107+
- name: Save screenshots
108+
if: ${{ always() }}
109+
uses: actions/upload-artifact@v3
110+
with:
111+
name: screenshots-${{ matrix.device }}-${{ matrix.os_version }}
112+
path: .github/start-mobile-example/*.png
113+
114+
check-result:
115+
runs-on: ubuntu-latest
116+
timeout-minutes: 30
117+
needs: [run]
118+
steps:
119+
- name: Wait for screenshots comparison
120+
run: |
121+
npm install -g @percy/cli@latest
122+
npx percy build:wait --project dede4209/Bevy-Mobile-Example --commit ${{ github.sha }} --fail-on-changes --pass-if-approved
123+
env:
124+
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}

0 commit comments

Comments
 (0)