BlueWallet/.github/workflows/ci.yml

150 lines
4.7 KiB
YAML
Raw Normal View History

2020-06-23 14:40:51 +03:00
name: Tests
# https://dev.to/edvinasbartkus/running-react-native-detox-tests-for-ios-and-android-on-github-actions-2ekn
# https://medium.com/@reime005/the-best-ci-cd-for-react-native-with-e2e-support-4860b4aaab29
2023-10-07 22:31:18 +01:00
env:
TRAVIS: 1
HD_MNEMONIC: ${{ secrets.HD_MNEMONIC }}
HD_MNEMONIC_BIP84: ${{ secrets.HD_MNEMONIC_BIP84 }}
on: [pull_request]
2020-06-23 14:40:51 +03:00
jobs:
test:
2022-07-27 19:18:15 +01:00
runs-on: macos-latest
2020-06-23 14:40:51 +03:00
steps:
- name: Checkout project
2022-03-01 19:21:24 +00:00
uses: actions/checkout@v3
2020-06-23 14:40:51 +03:00
- name: Specify node version
uses: actions/setup-node@v2-beta
with:
2022-01-14 12:18:41 +03:00
node-version: 16
2020-06-23 14:40:51 +03:00
- name: Use npm caches
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Use node_modules caches
id: cache-nm
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-nm-${{ hashFiles('package-lock.json') }}
- name: Install node_modules
if: steps.cache-nm.outputs.cache-hit != 'true'
run: npm install
- name: Run tests
run: npm test || npm test || npm test
env:
2023-02-09 22:13:47 -05:00
BIP47_HD_MNEMONIC: ${{ secrets.BIP47_HD_MNEMONIC}}
2020-06-23 14:40:51 +03:00
HD_MNEMONIC: ${{ secrets.HD_MNEMONIC }}
HD_MNEMONIC_BIP49: ${{ secrets.HD_MNEMONIC_BIP49 }}
HD_MNEMONIC_BIP49_MANY_TX: ${{ secrets.HD_MNEMONIC_BIP49_MANY_TX }}
HD_MNEMONIC_BIP84: ${{ secrets.HD_MNEMONIC_BIP84 }}
HD_MNEMONIC_BREAD: ${{ secrets.HD_MNEMONIC_BREAD }}
2021-06-16 12:34:19 +01:00
FAULTY_ZPUB: ${{ secrets.FAULTY_ZPUB }}
MNEMONICS_COBO: ${{ secrets.MNEMONICS_COBO }}
MNEMONICS_COLDCARD: ${{ secrets.MNEMONICS_COLDCARD }}
2020-06-23 14:40:51 +03:00
e2e:
runs-on: macos-latest
steps:
- name: checkout
2022-03-01 19:21:24 +00:00
uses: actions/checkout@v3
2020-06-23 14:40:51 +03:00
- name: Specify node version
uses: actions/setup-node@v2-beta
with:
2022-01-14 12:18:41 +03:00
node-version: 16
2020-06-23 14:40:51 +03:00
- name: Use gradle caches
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Use npm caches
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Install node_modules
run: npm install
2020-06-23 14:40:51 +03:00
- name: Use specific Java version for sdkmanager to work
2022-07-27 19:18:15 +01:00
uses: actions/setup-java@v2
2020-06-23 14:40:51 +03:00
with:
2022-07-27 19:18:15 +01:00
distribution: 'temurin'
java-version: '11'
2020-06-23 14:40:51 +03:00
- name: Build
run: npm run e2e:release-build
2023-10-07 22:31:18 +01:00
- name: Test attempt 1
2020-06-23 14:40:51 +03:00
uses: reactivecircus/android-emulator-runner@v2
2023-10-07 22:31:18 +01:00
continue-on-error: true
id: test1
2020-06-23 14:40:51 +03:00
with:
api-level: 31
2020-06-23 14:40:51 +03:00
avd-name: Pixel_API_29_AOSP
2023-10-07 22:31:18 +01:00
force-avd-creation: false
2021-09-09 12:00:11 +01:00
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047
arch: x86_64
2023-10-07 22:31:18 +01:00
script: npm run e2e:release-test
- name: Test attempt 2
uses: reactivecircus/android-emulator-runner@v2
continue-on-error: true
id: test2
if: steps.test1.outcome != 'success'
with:
api-level: 31
avd-name: Pixel_API_29_AOSP
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047
arch: x86_64
script: npm run e2e:release-test
- name: Test attempt 3
uses: reactivecircus/android-emulator-runner@v2
continue-on-error: true
id: test3
2023-10-08 09:34:53 +01:00
if: steps.test1.outcome != 'success' && steps.test2.outcome != 'success'
2023-10-07 22:31:18 +01:00
with:
api-level: 31
avd-name: Pixel_API_29_AOSP
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047
arch: x86_64
script: npm run e2e:release-test
- name: Test attempt 4
uses: reactivecircus/android-emulator-runner@v2
2023-10-08 09:34:53 +01:00
if: steps.test1.outcome != 'success' && steps.test2.outcome != 'success' && steps.test3.outcome != 'success'
2023-10-07 22:31:18 +01:00
with:
api-level: 31
avd-name: Pixel_API_29_AOSP
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047
arch: x86_64
script: npm run e2e:release-test
2020-06-23 14:40:51 +03:00
- uses: actions/upload-artifact@v2
2020-06-23 14:40:51 +03:00
if: failure()
with:
name: e2e-test-videos
path: ./artifacts/