-
Notifications
You must be signed in to change notification settings - Fork 15
178 lines (165 loc) · 6.71 KB
/
daily.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
#
# 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