Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 28 additions & 81 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -1,94 +1,41 @@
---
name: End-to-end
name: Integration

on:
push:
branches:
- main
- 'release/**'
schedule:
- cron: "0 3 * * *"

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
- "main"
tags:
- "*"

jobs:
end-to-end:
name: build
runs-on: macos-13
integrate-revision:
if: github.ref == 'refs/heads/main'
name: Integrate revision
runs-on: ubuntu-latest

steps:
- name: Mask apikey
env:
APIKEY: ${{ inputs.apiKey || secrets.APIKEY }}
run: echo "::add-mask::${{env.APIKEY}}"

- name: Checkout Code
uses: actions/checkout@v3

- uses: maxim-lobanov/setup-xcode@v1
- name: Dispatch integration
uses: peter-evans/repository-dispatch@v3
with:
xcode-version: '15.0.1'
token: ${{ secrets.IDENTUS_CI }}
repository: hyperledger-identus/integration
event-type: integration
client-payload: '{"component": "sdk-swift", "release": false, "version": "${{ github.sha }}" }'

# - name: Install SSH Key
# uses: shimataro/ssh-key-action@v2.3.0
# with:
# key: ${{ secrets.SSH_PRIVATE_KEY }}
# known_hosts: github.com
#
# - name: Adding Known Hosts
# run: ssh-keyscan -H github.com >> ~/.ssh/known_hosts
integrate-release:
if: startsWith(github.ref, 'refs/tags/')
name: Integrate release
runs-on: ubuntu-latest

- name: Create properties file
working-directory: E2E/e2eTests/Resources
env:
MEDIATOR_OOB_URL: ${{ inputs.mediatorOobUrl || vars.MEDIATOR_OOB_URL }}
PRISM_AGENT_URL: ${{ inputs.prismAgentUrl || vars.PRISM_AGENT_URL }}
PUBLISHED_DID: ${{ inputs.publishedDid || vars.PUBLISHED_DID }}
JWT_SCHEMA_GUID: ${{ inputs.jwtSchemaGuid || vars.JWT_SCHEMA_GUID }}
ANONCRED_DEFINITION_GUID: ${{ inputs.anoncredDefinitionGuid || vars.ANONCRED_DEFINITION_GUID }}
APIKEY: ${{ inputs.apiKey || secrets.APIKEY }}
run: |
cat <<EOL > properties.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>MEDIATOR_OOB_URL</key>
<string>${{env.MEDIATOR_OOB_URL}}</string>
<key>PRISM_AGENT_URL</key>
<string>${{env.PRISM_AGENT_URL}}</string>
<key>APIKEY</key>
<string>${{env.APIKEY}}</string>
<key>PUBLISHED_DID</key>
<string>${{env.PUBLISHED_DID}}</string>
<key>JWT_SCHEMA_GUID</key>
<string>${{env.JWT_SCHEMA_GUID}}</string>
<key>ANONCRED_DEFINITION_GUID</key>
<string>${{env.ANONCRED_DEFINITION_GUID}}</string>
</dict>
</plist>
EOL

- name: Run tests
working-directory: E2E
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: xcodebuild build test -scheme "e2e-Package" -destination "platform=iOS Simulator,name=IPhone 14" -resultBundlePath e2eTests/Target/TestResults.xcresult -skipPackagePluginValidation | xcpretty

- name: Publish tests results
uses: kishikawakatsumi/xcresulttool@v1.7.1
with:
path: E2E/e2eTests/Target/TestResults.xcresult
token: ${{ secrets.GITHUB_TOKEN }}
show-code-coverage: true
if: success() || failure()
steps:
- name: Get tag
id: tag
run: echo "name=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"

- name: Publish report
uses: actions/upload-artifact@v4
- name: Dispatch integration
uses: peter-evans/repository-dispatch@v3
with:
name: swift-report
path: E2E/e2eTests/Target/report.html
if-no-files-found: error
token: ${{ secrets.IDENTUS_CI }}
repository: hyperledger-identus/integration
event-type: integration
client-payload: '{"component": "sdk-swift", "release": true, "version": "${{ steps.tag.outputs.name }}" }'