fix: new zingolib commit f8c914a5 #6
Workflow file for this run
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: Integration test | ||
on: | ||
workflow_call: | ||
inputs: | ||
timestamp: | ||
required: true | ||
type: string | ||
cache-key: | ||
required: true | ||
type: string | ||
abi: | ||
required: true | ||
type: string | ||
env: | ||
CACHE-KEY: ${{ inputs.cache-key }} | ||
TIMESTAMP: ${{ inputs.timestamp }} | ||
ABI: ${{ inputs.abi }} | ||
REPO-OWNER: ${{ github.repository_owner }} | ||
RUSTFLAGS: -D warnings | ||
jobs: | ||
testing-sh: | ||
name: Testing sh script | ||
runs-on: macos-latest | ||
timeout-minutes: 120 | ||
steps: | ||
- name: Set envs for zingolib CI | ||
if: ${{ contains(github.repository, 'zingolib') }} | ||
run: echo "REPO-OWNER=zingolabs" >> $GITHUB_ENV | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: ${{ env.REPO-OWNER }}/zingo-mobile | ||
- name: Set envs for x86_64 | ||
if: ${{ env.ABI == 'x86_64' }} | ||
run: | | ||
echo "AVD-ARCH=x86_64" >> $GITHUB_ENV | ||
- name: Set envs for x86 | ||
if: ${{ env.ABI == 'x86' }} | ||
run: | | ||
echo "AVD-ARCH=x86" >> $GITHUB_ENV | ||
- name: Set envs for arm64-v8a | ||
if: ${{ env.ABI == 'arm64-v8a' }} | ||
run: | | ||
echo "AVD-ARCH=x86_64" >> $GITHUB_ENV | ||
- name: Set envs for armeabi-v7a | ||
if: ${{ env.ABI == 'armeabi-v7a' }} | ||
run: | | ||
echo "AVD-ARCH=x86" >> $GITHUB_ENV | ||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '18' | ||
- name: Setup Android SDK | ||
uses: android-actions/setup-android@v3 | ||
- name: AVD cache | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: | | ||
~/.android/avd/* | ||
~/.android/adb* | ||
key: avd-${{ env.AVD-ARCH }}-integ | ||
- name: Native rust library cache | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: android/app/src/main/jniLibs/${{ env.ABI }} | ||
key: native-rust-${{ env.ABI }}-${{ env.CACHE-KEY }} | ||
fail-on-cache-miss: true | ||
- name: Add emulator to PATH | ||
run: | | ||
echo "${ANDROID_SDK_ROOT}/emulator" >> $GITHUB_PATH | ||
- name: Gradle cache | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
gradle-version: 7.5 | ||
build-root-directory: ./android | ||
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' }} | ||
- name: sh testing | ||
uses: nick-fields/retry@v2 | ||
with: | ||
timeout_minutes: 120 | ||
max_attempts: 3 | ||
command: ./scripts/integration_tests.sh -a ${{ env.AVD-ARCH }} | ||
build-test-artifacts: | ||
name: Build test artifacts | ||
runs-on: macos-latest | ||
timeout-minutes: 120 | ||
needs: testing-sh | ||
steps: | ||
- name: Set envs for zingolib CI | ||
if: ${{ contains(github.repository, 'zingolib') }} | ||
run: echo "REPO-OWNER=zingolabs" >> $GITHUB_ENV | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: ${{ env.REPO-OWNER }}/zingo-mobile | ||
- name: Set envs for x86_64 | ||
if: ${{ env.ABI == 'x86_64' }} | ||
run: | | ||
echo "AVD-ARCH=x86_64" >> $GITHUB_ENV | ||
- name: Set envs for x86 | ||
if: ${{ env.ABI == 'x86' }} | ||
run: | | ||
echo "AVD-ARCH=x86" >> $GITHUB_ENV | ||
- name: Set envs for arm64-v8a | ||
if: ${{ env.ABI == 'arm64-v8a' }} | ||
run: | | ||
echo "AVD-ARCH=x86_64" >> $GITHUB_ENV | ||
- name: Set envs for armeabi-v7a | ||
if: ${{ env.ABI == 'armeabi-v7a' }} | ||
run: | | ||
echo "AVD-ARCH=x86" >> $GITHUB_ENV | ||
- name: Install docker | ||
run: | | ||
brew install docker | ||
colima start | ||
- name: Pull regchest docker image | ||
run: docker pull zingodevops/regchest:007 | ||
- name: Install nextest | ||
uses: taiki-e/install-action@nextest | ||
- name: Native rust library cache | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: android/app/src/main/jniLibs/${{ env.ABI }} | ||
key: native-rust-${{ env.ABI }}-${{ env.CACHE-KEY }} | ||
fail-on-cache-miss: true | ||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '18' | ||
- name: Setup Android SDK | ||
uses: android-actions/setup-android@v3 | ||
- name: AVD cache | ||
uses: actions/cache/restore@v3 | ||
id: avd-cache-snapshot | ||
with: | ||
path: | | ||
~/.android/avd/* | ||
~/.android/adb* | ||
key: avd-${{ env.AVD-ARCH }}-integ | ||
- name: Add emulator to PATH | ||
run: echo "${ANDROID_SDK_ROOT}/emulator" >> $GITHUB_PATH | ||
- name: Gradle cache | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
gradle-version: 7.5 | ||
build-root-directory: ./android | ||
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' }} | ||
- name: SH script | ||
uses: nick-fields/retry@v2 | ||
with: | ||
timeout_minutes: 120 | ||
max_attempts: 3 | ||
command: ./scripts/integration_tests.sh -a ${{ env.ABI }} -e ExecuteSaplingBalanceFromSeed | ||
- name: Upload test reports | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: sh-test-reports-${{ env.ABI }}-${{ matrix.partition}}-${{ env.TIMESTAMP }} | ||
path: android/app/build/outputs/integration_test_reports | ||
build-test-artifacts: | ||
name: Build test artifacts | ||
runs-on: macos-latest | ||
needs: sh-script-integration-test | ||
timeout-minutes: 120 | ||
steps: | ||
- name: Set envs for zingolib CI | ||
if: ${{ contains(github.repository, 'zingolib') }} | ||
run: echo "REPO-OWNER=zingolabs" >> $GITHUB_ENV | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: ${{ env.REPO-OWNER }}/zingo-mobile | ||
- name: Set envs for x86_64 | ||
if: ${{ env.ABI == 'x86_64' }} | ||
run: | | ||
echo "AVD-ARCH=x86_64" >> $GITHUB_ENV | ||
- name: Set envs for x86 | ||
if: ${{ env.ABI == 'x86' }} | ||
run: | | ||
echo "AVD-ARCH=x86" >> $GITHUB_ENV | ||
- name: Set envs for arm64-v8a | ||
if: ${{ env.ABI == 'arm64-v8a' }} | ||
run: | | ||
echo "AVD-ARCH=x86_64" >> $GITHUB_ENV | ||
- name: Set envs for armeabi-v7a | ||
if: ${{ env.ABI == 'armeabi-v7a' }} | ||
run: | | ||
echo "AVD-ARCH=x86" >> $GITHUB_ENV | ||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '18' | ||
- name: Setup Android SDK | ||
uses: android-actions/setup-android@v3 | ||
- name: AVD cache | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: | | ||
~/.android/avd/* | ||
~/.android/adb* | ||
key: avd-${{ env.AVD-ARCH }}-integ | ||
- name: Native rust library cache | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: android/app/src/main/jniLibs/${{ env.ABI }} | ||
key: native-rust-${{ env.ABI }}-${{ env.CACHE-KEY }} | ||
fail-on-cache-miss: true | ||
- name: Add emulator to PATH | ||
run: | | ||
echo "${ANDROID_SDK_ROOT}/emulator" >> $GITHUB_PATH | ||
- name: Gradle cache | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
gradle-version: 7.5 | ||
build-root-directory: ./android | ||
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' }} | ||
- name: sh testing | ||
uses: nick-fields/retry@v2 | ||
with: | ||
timeout_minutes: 120 | ||
max_attempts: 3 | ||
command: ./scripts/integration_tests.sh -a ${{ env.AVD-ARCH }} | ||
build-test-artifacts: | ||
name: Build test artifacts | ||
runs-on: macos-latest | ||
timeout-minutes: 120 | ||
needs: testing-sh | ||
steps: | ||
- name: Set envs for zingolib CI | ||
if: ${{ contains(github.repository, 'zingolib') }} | ||
run: echo "REPO-OWNER=zingolabs" >> $GITHUB_ENV | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: ${{ env.REPO-OWNER }}/zingo-mobile | ||
- name: Set envs for x86_64 | ||
if: ${{ env.ABI == 'x86_64' }} | ||
run: | | ||
echo "AVD-ARCH=x86_64" >> $GITHUB_ENV | ||
- name: Set envs for x86 | ||
if: ${{ env.ABI == 'x86' }} | ||
run: | | ||
echo "AVD-ARCH=x86" >> $GITHUB_ENV | ||
- name: Set envs for arm64-v8a | ||
if: ${{ env.ABI == 'arm64-v8a' }} | ||
run: | | ||
echo "AVD-ARCH=x86_64" >> $GITHUB_ENV | ||
- name: Set envs for armeabi-v7a | ||
if: ${{ env.ABI == 'armeabi-v7a' }} | ||
run: | | ||
echo "AVD-ARCH=x86" >> $GITHUB_ENV | ||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '18' | ||
- name: Setup Android SDK | ||
uses: android-actions/setup-android@v3 | ||
- name: AVD cache | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: | | ||
~/.android/avd/* | ||
~/.android/adb* | ||
key: avd-${{ env.AVD-ARCH }}-integ | ||
- name: Native rust library cache | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: android/app/src/main/jniLibs/${{ env.ABI }} | ||
key: native-rust-${{ env.ABI }}-${{ env.CACHE-KEY }} | ||
fail-on-cache-miss: true | ||
- name: Add emulator to PATH | ||
run: | | ||
echo "${ANDROID_SDK_ROOT}/emulator" >> $GITHUB_PATH | ||
- name: Gradle cache | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
gradle-version: 7.5 | ||
build-root-directory: ./android | ||
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' }} | ||
- name: sh testing | ||
uses: nick-fields/retry@v2 | ||
with: | ||
timeout_minutes: 120 | ||
max_attempts: 3 | ||
command: ./scripts/integration_tests.sh -a ${{ env.AVD-ARCH }} | ||
build-test-artifacts: | ||
name: Build test artifacts | ||
runs-on: macos-latest | ||
timeout-minutes: 120 | ||
needs: testing-sh | ||
steps: | ||
- name: Set envs for zingolib CI | ||
if: ${{ contains(github.repository, 'zingolib') }} | ||
run: echo "REPO-OWNER=zingolabs" >> $GITHUB_ENV | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ env.REPO-OWNER }}/zingo-mobile | ||
- name: Install protoc | ||
run: brew install protobuf | ||
- name: Install nextest | ||
uses: taiki-e/install-action@nextest | ||
- name: Cargo cache | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
shared-key: ${{ env.ABI }} | ||
workspaces: rust | ||
- name: Build and archive tests | ||
working-directory: ./rust | ||
run: cargo-nextest nextest archive --verbose --features "ci regchest" --archive-file nextest-archive-${{ env.ABI }}.tar.zst | ||
- name: Upload archive | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: nextest-archive-${{ env.ABI }} | ||
path: ./rust/nextest-archive-${{ env.ABI }}.tar.zst | ||
avd-snapshot-cache: | ||
name: AVD snapshot cache | ||
runs-on: macos-latest | ||
timeout-minutes: 120 | ||
needs: build-test-artifacts | ||
steps: | ||
- name: Set envs for zingolib CI | ||
if: ${{ contains(github.repository, 'zingolib') }} | ||
run: echo "REPO-OWNER=zingolabs" >> $GITHUB_ENV | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ env.REPO-OWNER }}/zingo-mobile | ||
- name: Set envs for x86_64 | ||
if: ${{ env.ABI == 'x86_64' }} | ||
run: | | ||
echo "AVD-ARCH=x86_64" >> $GITHUB_ENV | ||
- name: Set envs for x86 | ||
if: ${{ env.ABI == 'x86' }} | ||
run: | | ||
echo "AVD-ARCH=x86" >> $GITHUB_ENV | ||
- name: Set envs for arm64-v8a | ||
if: ${{ env.ABI == 'arm64-v8a' }} | ||
run: | | ||
echo "AVD-ARCH=x86_64" >> $GITHUB_ENV | ||
- name: Set envs for armeabi-v7a | ||
if: ${{ env.ABI == 'armeabi-v7a' }} | ||
run: | | ||
echo "AVD-ARCH=x86" >> $GITHUB_ENV | ||
- name: AVD cache | ||
uses: actions/cache/restore@v4 | ||
id: avd-cache-snapshot | ||
with: | ||
path: | | ||
~/.android/avd/* | ||
~/.android/adb* | ||
key: avd-${{ env.AVD-ARCH }}-integ | ||
lookup-only: true | ||
- name: Setup Java | ||
if: steps.avd-cache-snapshot.outputs.cache-hit != 'true' | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '18' | ||
- name: Setup Android SDK | ||
if: steps.avd-cache-snapshot.outputs.cache-hit != 'true' | ||
uses: android-actions/setup-android@v3 | ||
- name: Add emulator to PATH | ||
if: steps.avd-cache-snapshot.outputs.cache-hit != 'true' | ||
run: | | ||
echo "${ANDROID_SDK_ROOT}/emulator" >> $GITHUB_PATH | ||
- name: Create AVD and generate snapshot for caching | ||
if: steps.avd-cache-snapshot.outputs.cache-hit != 'true' | ||
uses: nick-fields/retry@v2 | ||
with: | ||
timeout_minutes: 120 | ||
max_attempts: 3 | ||
command: ./scripts/integration_tests.sh -a ${{ env.ABI }} -s | ||
- name: AVD cache snapshot | ||
if: steps.avd-cache-snapshot.outputs.cache-hit != 'true' | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: | | ||
~/.android/avd/* | ||
~/.android/adb* | ||
key: avd-${{ env.AVD-ARCH }}-integ | ||
integration-test: | ||
name: Integration test | ||
runs-on: macos-latest | ||
timeout-minutes: 120 | ||
needs: [ build-test-artifacts, avd-snapshot-cache ] | ||
strategy: | ||
matrix: | ||
partition: [1, 2, 3, 4, 5] | ||
steps: | ||
- name: Set envs for zingolib CI | ||
if: ${{ contains(github.repository, 'zingolib') }} | ||
run: echo "REPO-OWNER=zingolabs" >> $GITHUB_ENV | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ env.REPO-OWNER }}/zingo-mobile | ||
- name: Set envs for x86_64 | ||
if: ${{ env.ABI == 'x86_64' }} | ||
run: | | ||
echo "AVD-ARCH=x86_64" >> $GITHUB_ENV | ||
echo "NEXTEST-ABI=x86_64" >> $GITHUB_ENV | ||
- name: Set envs for x86 | ||
if: ${{ env.ABI == 'x86' }} | ||
run: | | ||
echo "AVD-ARCH=x86" >> $GITHUB_ENV | ||
echo "NEXTEST-ABI=x86_32" >> $GITHUB_ENV | ||
- name: Set envs for arm64-v8a | ||
if: ${{ env.ABI == 'arm64-v8a' }} | ||
run: | | ||
echo "AVD-ARCH=x86_64" >> $GITHUB_ENV | ||
echo "NEXTEST-ABI=arm64" >> $GITHUB_ENV | ||
- name: Set envs for armeabi-v7a | ||
if: ${{ env.ABI == 'armeabi-v7a' }} | ||
run: | | ||
echo "AVD-ARCH=x86" >> $GITHUB_ENV | ||
echo "NEXTEST-ABI=arm32" >> $GITHUB_ENV | ||
- name: Install docker | ||
run: | | ||
brew install docker | ||
colima start | ||
- name: Pull regchest docker image | ||
run: docker pull zingodevops/regchest:007 | ||
- name: Install nextest | ||
uses: taiki-e/install-action@nextest | ||
- name: Cargo cache | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
workspaces: rust | ||
- name: Native rust cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: android/app/src/main/jniLibs/${{ env.ABI }} | ||
key: native-rust-${{ env.ABI }}-${{ env.CACHE-KEY }} | ||
fail-on-cache-miss: true | ||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '18' | ||
- name: Setup Android SDK | ||
uses: android-actions/setup-android@v3 | ||
- name: AVD cache | ||
uses: actions/cache/restore@v4 | ||
id: avd-cache-snapshot | ||
with: | ||
path: | | ||
~/.android/avd/* | ||
~/.android/adb* | ||
key: avd-${{ env.AVD-ARCH }}-integ | ||
- name: Add emulator to PATH | ||
run: echo "${ANDROID_SDK_ROOT}/emulator" >> $GITHUB_PATH | ||
- name: Gradle cache | ||
uses: gradle/gradle-build-action@v3-beta | ||
with: | ||
gradle-version: 7.5 | ||
build-root-directory: ./android | ||
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' }} | ||
- name: Download archive | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: nextest-archive-${{ env.ABI }} | ||
path: ./rust | ||
- name: Cargo cache | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
shared-key: ${{ env.ABI }} | ||
workspaces: rust | ||
- name: Run integration tests | ||
working-directory: ./rust | ||
run: | | ||
cargo-nextest nextest run ${{ env.NEXTEST-ABI }} --verbose --profile ci \ | ||
--archive-file nextest-archive-${{ env.ABI }}.tar.zst \ | ||
--partition count:${{ matrix.partition}}/5 | ||
- name: Upload test reports rust-sh | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: test-reports-rust-sh-${{ env.ABI }}-${{ matrix.partition}}-${{ env.TIMESTAMP }} | ||
path: | | ||
./rust/rust-sh.txt | ||
./rust/rust-sh-errors.txt | ||
- name: Upload test reports | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: test-reports-${{ env.ABI }}-${{ matrix.partition}}-${{ env.TIMESTAMP }} | ||
path: android/app/build/outputs/integration_test_reports | ||