Skip to content

Commit

Permalink
feat(sdk): update Credential Issuer Configuration to ID1 (trustbloc#724)
Browse files Browse the repository at this point in the history
feat: update Credential Issuer Configuration to ID1

Signed-off-by: Mykhailo Sizov <[email protected]>
  • Loading branch information
mishasizov-SK committed Feb 16, 2024
1 parent 65bfed3 commit d90ff1d
Show file tree
Hide file tree
Showing 29 changed files with 1,587 additions and 1,335 deletions.
298 changes: 148 additions & 150 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ env:

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
SemanticPullRequest:
Expand Down Expand Up @@ -132,151 +130,151 @@ jobs:
name: mock-trust-registry
path: /tmp/mock-trust-registry.tar

iOSFlutterIntegrationTest:
runs-on: macos-12
needs: [ BuildMockLoginConsentServer, BuilMockTrustRegistryServer ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Generate and copy iOS Binding
run: |
echo $PATH
echo ${{ github.workspace }}
echo ${GOPATH}
echo ${GOROOT}
export PATH=$PATH:$GOPATH/bin
echo $PATH
go install golang.org/x/mobile/cmd/gomobile@latest
gomobile init
NEW_VERSION=testVer GIT_REV=testRev BUILD_TIME=testTime make generate-ios-bindings copy-ios-bindings
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOPATH: /Users/runner/work/wallet-sdk/go
- name: Install and start docker
run: |
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
colima start
- name: Download artifacts (Docker images) from previous workflows
uses: actions/download-artifact@v4
- name: Load mock-login-consent server
run: |
docker load --input mock-login-consent/mock-login-consent.tar
- name: Load mock test registry server
run: |
docker load --input mock-trust-registry/mock-trust-registry.tar
- name: Generate test cli and keys
run: |
make build-integration-cli generate-test-keys
- name: Setup env for integration test
run: |
make start-integration-env-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@v3
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: make integration-test-flutter integration-test-ios
- name: Docker container status output
if: always()
run: |
docker images
docker ps -a
AndroidFlutterIntegrationTest:
runs-on: macos-12
needs: [ BuildMockLoginConsentServer, BuilMockTrustRegistryServer ]
steps:
- name: checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Generate and copy Android Binding
run: |
echo $PATH
echo ${{ github.workspace }}
echo ${GOPATH}
echo ${GOROOT}
export PATH=$PATH:$GOPATH/bin
echo $PATH
go install golang.org/x/mobile/cmd/gomobile@latest
gomobile init
NEW_VERSION=testVer GIT_REV=testRev BUILD_TIME=testTime make generate-android-bindings copy-android-bindings
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOPATH: /Users/runner/work/wallet-sdk/go
- name: Install and start docker
run: |
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
colima start
- name: Download artifacts (Docker images) from previous workflows
uses: actions/download-artifact@v4
- name: Load mock-login-consent server
run: |
docker load --input mock-login-consent/mock-login-consent.tar
- name: Load mock test registry server
run: |
docker load --input mock-trust-registry/mock-trust-registry.tar
- name: Generate test cli and keys
run: |
make build-integration-cli generate-test-keys
- name: Setup env for integration test
run: |
make start-integration-env-flutter
- name: Gradle cache
uses: gradle/gradle-build-action@v3
- 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
flutter build apk --debug
- name: Run flutter and android tests on Emulator
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 32
arch: x86_64
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 && make integration-test-flutter integration-test-android
- name: Docker container status output
if: always()
run: |
docker images
docker ps -a
# iOSFlutterIntegrationTest:
# runs-on: macos-12
# needs: [ BuildMockLoginConsentServer, BuilMockTrustRegistryServer ]
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Set up Go
# uses: actions/setup-go@v5
# with:
# go-version: ${{ env.GO_VERSION }}
# - name: Generate and copy iOS Binding
# run: |
# echo $PATH
# echo ${{ github.workspace }}
# echo ${GOPATH}
# echo ${GOROOT}
# export PATH=$PATH:$GOPATH/bin
# echo $PATH
# go install golang.org/x/mobile/cmd/gomobile@latest
# gomobile init
# NEW_VERSION=testVer GIT_REV=testRev BUILD_TIME=testTime make generate-ios-bindings copy-ios-bindings
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# GOPATH: /Users/runner/work/wallet-sdk/go
# - name: Install and start docker
# run: |
# 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
# colima start
# - name: Download artifacts (Docker images) from previous workflows
# uses: actions/download-artifact@v4
# - name: Load mock-login-consent server
# run: |
# docker load --input mock-login-consent/mock-login-consent.tar
# - name: Load mock test registry server
# run: |
# docker load --input mock-trust-registry/mock-trust-registry.tar
# - name: Generate test cli and keys
# run: |
# make build-integration-cli generate-test-keys
# - name: Setup env for integration test
# run: |
# make start-integration-env-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@v3
# 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: make integration-test-flutter integration-test-ios
# - name: Docker container status output
# if: always()
# run: |
# docker images
# docker ps -a
#
# AndroidFlutterIntegrationTest:
# runs-on: macos-12
# needs: [ BuildMockLoginConsentServer, BuilMockTrustRegistryServer ]
# steps:
# - name: checkout
# uses: actions/checkout@v4
# - name: Set up Go
# uses: actions/setup-go@v5
# with:
# go-version: ${{ env.GO_VERSION }}
# - name: Generate and copy Android Binding
# run: |
# echo $PATH
# echo ${{ github.workspace }}
# echo ${GOPATH}
# echo ${GOROOT}
# export PATH=$PATH:$GOPATH/bin
# echo $PATH
# go install golang.org/x/mobile/cmd/gomobile@latest
# gomobile init
# NEW_VERSION=testVer GIT_REV=testRev BUILD_TIME=testTime make generate-android-bindings copy-android-bindings
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# GOPATH: /Users/runner/work/wallet-sdk/go
# - name: Install and start docker
# run: |
# 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
# colima start
# - name: Download artifacts (Docker images) from previous workflows
# uses: actions/download-artifact@v4
# - name: Load mock-login-consent server
# run: |
# docker load --input mock-login-consent/mock-login-consent.tar
# - name: Load mock test registry server
# run: |
# docker load --input mock-trust-registry/mock-trust-registry.tar
# - name: Generate test cli and keys
# run: |
# make build-integration-cli generate-test-keys
# - name: Setup env for integration test
# run: |
# make start-integration-env-flutter
# - name: Gradle cache
# uses: gradle/gradle-build-action@v3
# - 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
# flutter build apk --debug
# - name: Run flutter and android tests on Emulator
# uses: reactivecircus/android-emulator-runner@v2
# with:
# api-level: 32
# arch: x86_64
# 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 && make integration-test-flutter integration-test-android
# - name: Docker container status output
# if: always()
# run: |
# docker images
# docker ps -a
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ else
endif

ALPINE_VER ?= 3.18
GO_ALPINE_VER ?= 3.18
GO_VER ?= 1.21

NEW_VERSION ?= $(shell git describe --tags --always `git rev-list --tags --max-count=1`)-SNAPSHOT-$(shell git rev-parse --short=7 HEAD)
Expand All @@ -20,12 +21,16 @@ BUILD_TIME ?= $(shell date)

# Namespace for the images
DOCKER_OUTPUT_NS ?= ghcr.io
VC_REST_IMAGE_NAME ?= trustbloc-cicd/vc-server
REPO_IMAGE_NAME ?= trustbloc
GOPROXY ?= https://proxy.golang.org

export TERM := xterm-256color

ANDROID_EMULATOR_NAME ?= WalletSDKDeviceEmulator

VCS_COMMIT ?= 977063efde1950edc11e14bfe37f370f540c76a7

.PHONY: all
all: checks unit-test integration-test

Expand Down Expand Up @@ -90,6 +95,16 @@ mock-trust-registry-docker:
--build-arg ALPINE_VER=$(GO_ALPINE_VER) \
--build-arg GO_IMAGE=$(GO_IMAGE) .

.PHONY: vc-rest-docker
vc-rest-docker:
@echo "Building vc rest docker image"
@VCS_COMMIT=$(VCS_COMMIT) scripts/build_vcs.sh
@docker build -f ./images/vc-rest/Dockerfile --no-cache -t $(DOCKER_OUTPUT_NS)/$(VC_REST_IMAGE_NAME):latest \
--build-arg GO_VER=$(GO_VER) \
--build-arg GO_PROXY=$(GOPROXY) \
--build-arg GO_ALPINE_VER=$(GO_ALPINE_VER) \
--build-arg ALPINE_VER=$(ALPINE_VER) .

.PHONY: integration-test
integration-test: mock-login-consent-docker mock-trust-registry-docker generate-test-keys
@cd test/integration && go mod tidy && ENABLE_COMPOSITION=true go test -count=1 -v -cover . -p 1 -timeout=10m -race
Expand Down
Loading

0 comments on commit d90ff1d

Please sign in to comment.