1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

feat: project init

This commit is contained in:
steven 2023-03-16 10:20:57 +08:00
parent eb1c9ff5de
commit b4b8856ed2

View File

@ -59,77 +59,77 @@ jobs:
with: with:
node-version: 16 node-version: 16
# - name: Configure JDK 1.11 - name: Configure JDK 1.11
# uses: actions/setup-java@v3 uses: actions/setup-java@v3
# with: with:
# distribution: 'temurin' distribution: 'temurin'
# java-version: '11' java-version: '11'
# # Set path variables needed for caches # Set path variables needed for caches
# - name: Set workflow variables - name: Set workflow variables
# id: workflow-variables id: workflow-variables
# run: | run: |
# echo "metro-cache=$HOME/.metro" >> $GITHUB_OUTPUT echo "metro-cache=$HOME/.metro" >> $GITHUB_OUTPUT
# echo "yarn-cache-dir=$(yarn cache dir)" >> $GITHUB_OUTPUT echo "yarn-cache-dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
# echo "tempdir=$TMPDIR" >> $GITHUB_OUTPUT echo "tempdir=$TMPDIR" >> $GITHUB_OUTPUT
# - uses: actions/cache@v3 - uses: actions/cache@v3
# name: Yarn Cache name: Yarn Cache
# id: yarn-cache id: yarn-cache
# with: with:
# path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }} path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }}
# key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }} key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}
# restore-keys: ${{ runner.os }}-yarn-v1 restore-keys: ${{ runner.os }}-yarn-v1
# - name: Yarn Install - name: Yarn Install
# uses: nick-invision/retry@v2 uses: nick-invision/retry@v2
# with: with:
# timeout_minutes: 10 timeout_minutes: 10
# retry_wait_seconds: 60 retry_wait_seconds: 60
# max_attempts: 3 max_attempts: 3
# command: DETOX_DISABLE_POSTINSTALL=1 yarn --no-audit --prefer-offline command: DETOX_DISABLE_POSTINSTALL=1 yarn --no-audit --prefer-offline
# - name: Cache pushy Emulator - name: Cache pushy Emulator
# uses: actions/cache@v3 uses: actions/cache@v3
# with: with:
# path: ~/.cache/pushy/emulators path: ~/.cache/pushy/emulators
# key: pushy-emulators-v1-${{ github.run_id }} key: pushy-emulators-v1-${{ github.run_id }}
# restore-keys: pushy-emulators-v1 restore-keys: pushy-emulators-v1
# - name: Start pushy Emulator - name: Start pushy Emulator
# run: yarn tests:emulator:start-ci run: yarn tests:emulator:start-ci
# - uses: actions/cache@v3 - uses: actions/cache@v3
# name: Gradle Cache name: Gradle Cache
# with: with:
# path: ~/.gradle/caches path: ~/.gradle/caches
# key: ${{ runner.os }}-gradle-v1-${{ hashFiles('**/*.gradle*') }} key: ${{ runner.os }}-gradle-v1-${{ hashFiles('**/*.gradle*') }}
# restore-keys: ${{ runner.os }}-gradle-v1 restore-keys: ${{ runner.os }}-gradle-v1
# # This appears to be 'Cache Size: ~1230 MB (1290026823 B)' based on watching action logs # This appears to be 'Cache Size: ~1230 MB (1290026823 B)' based on watching action logs
# # Repo limit is 10GB; branch caches are independent; branches may read default branch cache. # Repo limit is 10GB; branch caches are independent; branches may read default branch cache.
# # We don't want branches to evict master branch snapshot, so save on master, read-only all else # We don't want branches to evict master branch snapshot, so save on master, read-only all else
# - name: AVD cache - name: AVD cache
# uses: actions/cache@v3 uses: actions/cache@v3
# id: avd-cache id: avd-cache
# with: with:
# path: | path: |
# ~/.android/avd/* ~/.android/avd/*
# ~/.android/adb* ~/.android/adb*
# key: avd-${{ matrix.api-level }}-${{ matrix.arch }}-${{matrix.target}}-v1-${{ github.event.inputs.clearCaches }} key: avd-${{ matrix.api-level }}-${{ matrix.arch }}-${{matrix.target}}-v1-${{ github.event.inputs.clearCaches }}
# restore-keys: | restore-keys: |
# avd-${{ matrix.api-level }}-${{ matrix.arch }}-${{matrix.target}}-v1 avd-${{ matrix.api-level }}-${{ matrix.arch }}-${{matrix.target}}-v1
# - name: Clear Caches Optionally - name: Clear Caches Optionally
# if: "${{ github.event.inputs.clearCaches != '' }}" if: "${{ github.event.inputs.clearCaches != '' }}"
# shell: bash shell: bash
# run: | run: |
# du -sk ~/.gradle du -sk ~/.gradle
# du -sk ~/.android du -sk ~/.android
# rm -fr ~/.gradle rm -fr ~/.gradle
# rm -fr ~/.android rm -fr ~/.android
# du -sk ~/.gradle || echo ~/.gradle is gone du -sk ~/.gradle || echo ~/.gradle is gone
# du -sk ~/.android || echo ~/.android is gone du -sk ~/.android || echo ~/.android is gone
- name: Build Android App - name: Build Android App
uses: nick-invision/retry@v2 uses: nick-invision/retry@v2
@ -139,65 +139,65 @@ jobs:
max_attempts: 3 max_attempts: 3
command: yarn build:android-release command: yarn build:android-release
# - name: Metro Bundler Cache - name: Metro Bundler Cache
# uses: actions/cache@v3 uses: actions/cache@v3
# with: with:
# path: ${{ steps.workflow-variables.outputs.metro-cache }} path: ${{ steps.workflow-variables.outputs.metro-cache }}
# key: ${{ runner.os }}-metro-v1-${{ github.run_id }} key: ${{ runner.os }}-metro-v1-${{ github.run_id }}
# restore-keys: ${{ runner.os }}-metro-v1 restore-keys: ${{ runner.os }}-metro-v1
# - name: AVD Boot and Snapshot Creation - name: AVD Boot and Snapshot Creation
# # Only generate a snapshot with a cache miss # Only generate a snapshot with a cache miss
# # Comment the if out to generate snapshots on branch for performance testing # Comment the if out to generate snapshots on branch for performance testing
# if: "${{ github.event.inputs.clearCaches != '' || (steps.avd-cache.outputs.cache-hit != 'true' && github.ref == 'refs/heads/master') }}" if: "${{ github.event.inputs.clearCaches != '' || (steps.avd-cache.outputs.cache-hit != 'true' && github.ref == 'refs/heads/master') }}"
# uses: reactivecircus/android-emulator-runner@v2 uses: reactivecircus/android-emulator-runner@v2
# with: with:
# api-level: ${{ matrix.api-level }} api-level: ${{ matrix.api-level }}
# avd-name: TestingAVD avd-name: TestingAVD
# force-avd-creation: false force-avd-creation: false
# target: ${{ matrix.target }} target: ${{ matrix.target }}
# arch: ${{ matrix.arch }} arch: ${{ matrix.arch }}
# emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
# sdcard-path-or-size: 100M sdcard-path-or-size: 100M
# disable-animations: true disable-animations: true
# # Give the emulator a little time to run and do first boot stuff before taking snapshot # Give the emulator a little time to run and do first boot stuff before taking snapshot
# script: | script: |
# $ANDROID_HOME/platform-tools/adb logcat '*:D' -d > adb-snapshot-log.txt $ANDROID_HOME/platform-tools/adb logcat '*:D' -d > adb-snapshot-log.txt
# $ANDROID_HOME/platform-tools/adb logcat --clear $ANDROID_HOME/platform-tools/adb logcat --clear
# echo "Generated AVD snapshot for caching." echo "Generated AVD snapshot for caching."
# # This step is separate so pure install time may be calculated as a step # This step is separate so pure install time may be calculated as a step
# - name: Emulator Snapshot After Firstboot Warmup - name: Emulator Snapshot After Firstboot Warmup
# # Only generate a snapshot for saving with a cache miss # Only generate a snapshot for saving with a cache miss
# # Switch the if statements via comment if generating snapshots for performance testing # Switch the if statements via comment if generating snapshots for performance testing
# # if: matrix.first-boot-delay != '0' # if: matrix.first-boot-delay != '0'
# if: "${{ github.event.inputs.clearCaches != '' || (steps.avd-cache.outputs.cache-hit != 'true' && github.ref == 'refs/heads/master') }}" if: "${{ github.event.inputs.clearCaches != '' || (steps.avd-cache.outputs.cache-hit != 'true' && github.ref == 'refs/heads/master') }}"
# env: env:
# FIRST_BOOT_DELAY: ${{ matrix.first-boot-delay }} FIRST_BOOT_DELAY: ${{ matrix.first-boot-delay }}
# uses: reactivecircus/android-emulator-runner@v2 uses: reactivecircus/android-emulator-runner@v2
# with: with:
# api-level: ${{ matrix.api-level }} api-level: ${{ matrix.api-level }}
# avd-name: TestingAVD avd-name: TestingAVD
# force-avd-creation: false force-avd-creation: false
# target: ${{ matrix.target }} target: ${{ matrix.target }}
# arch: ${{ matrix.arch }} arch: ${{ matrix.arch }}
# emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
# sdcard-path-or-size: 100M sdcard-path-or-size: 100M
# disable-animations: true disable-animations: true
# # Give the emulator a little time to run and do first boot stuff before taking snapshot # Give the emulator a little time to run and do first boot stuff before taking snapshot
# # The zygote restart makes sure zygote has correct heap size as a workaround for android emulator init bug # The zygote restart makes sure zygote has correct heap size as a workaround for android emulator init bug
# script: | script: |
# $ANDROID_HOME/platform-tools/adb shell su root "setprop ctl.restart zygote" $ANDROID_HOME/platform-tools/adb shell su root "setprop ctl.restart zygote"
# sleep $FIRST_BOOT_DELAY sleep $FIRST_BOOT_DELAY
# $ANDROID_HOME/platform-tools/adb logcat '*:D' -d > adb-warmup-log.txt $ANDROID_HOME/platform-tools/adb logcat '*:D' -d > adb-warmup-log.txt
# $ANDROID_HOME/platform-tools/adb logcat --clear $ANDROID_HOME/platform-tools/adb logcat --clear
# echo "First boot warmup completed." echo "First boot warmup completed."
# - name: Test Tapper - name: Test Tapper
# # Run this outside the emulator runner so the emulator runner does not wait on it for cleanup # Run this outside the emulator runner so the emulator runner does not wait on it for cleanup
# run: | run: |
# nohup sh -c "until false; do $ANDROID_HOME/platform-tools/adb shell input tap 100 800; sleep 0.2; done" & nohup sh -c "until false; do $ANDROID_HOME/platform-tools/adb shell input tap 100 800; sleep 0.2; done" &
# shell: bash shell: bash
- name: Detox Tests - name: Detox Tests
uses: reactivecircus/android-emulator-runner@v2 uses: reactivecircus/android-emulator-runner@v2