Skip to content

Wallet-SDK Daily Build #134

Wallet-SDK Daily Build

Wallet-SDK Daily Build #134

Workflow file for this run

#
# Copyright Gen Digital Inc. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
name: "Wallet-SDK Daily Build"
env:
GO_VERSION: '1.21'
on:
schedule:
- cron: "0 0 * * *"
jobs:
GenerateVersion:
runs-on: ubuntu-22.04
timeout-minutes: 10
outputs:
version: ${{ steps.store.outputs.version }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
lfs: true
- name: Get current published version
run: |
TAG=$(git describe --tags --always `git rev-list --tags --max-count=1`)
VERSION=$(git rev-parse --short=7 HEAD)
echo "repoTag=${TAG} repoVersion=${VERSION}"
if [[ $TAG == $VERSION ]]; then
TAG=v0.0.0
fi
echo "CURRENT_SEMVER=${TAG:0:5}" >> $GITHUB_ENV
echo "repoTag=${TAG} repoVersion=${VERSION} currentSemVer=${TAG:0:5}"
- name: Bump published version
id: bump_version
uses: christian-draeger/[email protected]
with:
current-version: '${{ env.CURRENT_SEMVER }}'
# TODO: needs to be configurable https://github.com/christian-draeger/increment-semantic-version#input--output-examples
version-fragment: 'bug'
- id: store
run: echo "version=${{ steps.bump_version.outputs.next-version }}" >> $GITHUB_OUTPUT
AndroidFlutterDailyTest:
needs: GenerateVersion
runs-on: macOS-12
steps:
- name: checkout
uses: actions/checkout@v3
- name: AVD cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-29
- name: Generate SDK version
run: |
echo "new version"
NEW_VER=${{ needs.GenerateVersion.outputs.version }}-SNAPSHOT-$(git rev-parse --short=7 HEAD)
echo $NEW_VER
echo "WALLET_SDK_VER=$NEW_VER" >> $GITHUB_ENV
- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Setup env for integration test
run: |
echo '127.0.0.1 testnet.orb.local' | sudo tee -a /etc/hosts
echo '127.0.0.1 file-server.trustbloc.local' | sudo tee -a /etc/hosts
echo '127.0.0.1 did-resolver.trustbloc.local' | sudo tee -a /etc/hosts
echo '127.0.0.1 vc-rest-echo.trustbloc.local' | sudo tee -a /etc/hosts
echo '127.0.0.1 api-gateway.trustbloc.local' | sudo tee -a /etc/hosts
echo '127.0.0.1 cognito-mock.trustbloc.local' | sudo tee -a /etc/hosts
brew install docker docker-compose
brew remove --ignore-dependencies qemu
curl -o ./qemu.rb https://raw.githubusercontent.com/Homebrew/homebrew-core/dc0669eca9479e9eeb495397ba3a7480aaa45c2e/Formula/qemu.rb
brew install ./qemu.rb
colima start
export PATH=$PATH:$GOPATH/bin
echo $PATH
go install golang.org/x/mobile/cmd/gomobile@latest
gomobile init
make prepare-integration-test-flutter
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
- name: Setup Flutter SDK
uses: flutter-actions/setup-flutter@v2
with:
channel: stable
version: 3.10.6
- name: Install flutter app dependencies
run: make install-flutter-dependencies
- name: Build APK in Debug mode
run: |
cd demo/app
WALLET_SDK_USR=GIT_USR WALLET_SDK_TKN=${GITHUB_TOKEN} WALLET_SDK_VER=${WALLET_SDK_VER} flutter build apk --debug
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WALLET_SDK_VER: '${{ env.WALLET_SDK_VER }}'
- name: Run tests on Emulator
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: adb reverse tcp:8075 tcp:8075 && adb reverse tcp:8072 tcp:8072 && adb reverse tcp:9229 tcp:9229 && WALLET_SDK_USR=GIT_USR WALLET_SDK_TKN=${GITHUB_TOKEN} WALLET_SDK_VER=${WALLET_SDK_VER} ./scripts/flutter_test.sh
env:
WALLET_SDK_VER: '${{ env.WALLET_SDK_VER }}'
iOSFlutterDailyTest:
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOPATH: /Users/runner/work/wallet-sdk/go
- name: Setup env for integration test
run: |
echo '127.0.0.1 testnet.orb.local' | sudo tee -a /etc/hosts
echo '127.0.0.1 file-server.trustbloc.local' | sudo tee -a /etc/hosts
echo '127.0.0.1 did-resolver.trustbloc.local' | sudo tee -a /etc/hosts
echo '127.0.0.1 vc-rest-echo.trustbloc.local' | sudo tee -a /etc/hosts
echo '127.0.0.1 api-gateway.trustbloc.local' | sudo tee -a /etc/hosts
echo '127.0.0.1 cognito-mock.trustbloc.local' | sudo tee -a /etc/hosts
brew install docker docker-compose
brew remove --ignore-dependencies qemu
curl -o ./qemu.rb https://raw.githubusercontent.com/Homebrew/homebrew-core/dc0669eca9479e9eeb495397ba3a7480aaa45c2e/Formula/qemu.rb
brew install ./qemu.rb
colima start
export PATH=$PATH:$GOPATH/bin
echo $PATH
make prepare-integration-test-flutter
- name: Setup Flutter SDK
uses: flutter-actions/setup-flutter@v2
with:
channel: stable
version: 3.10.6
- name: Install flutter app dependencies
run: make install-flutter-dependencies
- name: Run iOS Simulator
uses: futureware-tech/simulator-action@v2
with:
model: 'iPhone 14'
- name: Remove AppIcon contents file (Simulator build fails with this file)
run: |
rm -rf demo/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
rm -rf demo/app/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
- name: Run tests on Simulator
run: ./scripts/flutter_test.sh --flavor=PkgManager