Skip to content

Commit

Permalink
Merge pull request #128 from adobe/staging
Browse files Browse the repository at this point in the history
Staging -> Main - [v2.4.0 Release]
  • Loading branch information
addb committed Oct 27, 2023
2 parents 1718d25 + a39f495 commit 2519205
Show file tree
Hide file tree
Showing 62 changed files with 6,743 additions and 1,200 deletions.
51 changes: 51 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ workflows:
build-cache-prefix: v1
requires:
- validate-code

- integration-test:
gradle-cache-prefix: v1
build-cache-prefix: v1
requires:
- validate-code
filters:
branches:
only:
- main
- staging

jobs:
validate-code:
Expand Down Expand Up @@ -181,3 +192,43 @@ jobs:
# On test failures, the step in the Makefile to copy the reports to ci/ is not run, so store test results from build folder instead.
- store_test_results:
path: code/edge/build/outputs/androidTest-results

integration-test:
parameters:
gradle-cache-prefix:
type: string
default: v1
build-cache-prefix:
type: string
default: v1

# list of available Android machine images: https://circleci.com/developer/machine/image/android#image-tags
executor:
name: android/android-machine
resource-class: large
tag: 2022.09.1
steps:
- checkout

- android/restore-build-cache:
cache-prefix: << parameters.build-cache-prefix >>

- run:
name: List available emulator images
command: sdkmanager --list

- android/start-emulator-and-run-tests:
# It should match the name seen in the "sdkmanager --list" output
system-image: system-images;android-29;default;x86
# The command to be run, while waiting for emulator startup
post-emulator-launch-assemble-command: make ci-build
# The test command
test-command: make ci-upstream-integration-test
restore-gradle-cache-prefix: << parameters.gradle-cache-prefix >>

- android/save-build-cache:
cache-prefix: << parameters.build-cache-prefix >>

# On test failures, the step in the Makefile to copy the reports to ci/ is not run, so store test results from build folder instead.
- store_test_results:
path: code/integration-tests/build/outputs/androidTest-results/connected
103 changes: 103 additions & 0 deletions .github/workflows/upstream-integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
#
# Copyright 2023 Adobe. All rights reserved.
# This file is licensed to you under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
# OF ANY KIND, either express or implied. See the License for the specific language
# governing permissions and limitations under the License.
#

# Action to execute upstream integration tests - Edge Network (Konductor)
name: Integration Tests

# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to use when running integration tests'
required: false
default: 'main'
id:
description: 'Identifier for the run (optional)'
required: false
environment:
type: choice
description: 'Edge Network environment to test'
required: true
default: 'prod'
options:
- prod
- pre-prod
- int
edge-location-hint:
type: choice
description: 'Edge location hint to set before each test (optional)'
required: false
default: ''
options:
- '' # Interpreted in the test code as no preset location hint; any non-valid location hint string is interpreted this way
- 'or2'
- 'va6'
- 'irl1'
- 'ind1'
- 'jpn3'
- 'sgp3'
- 'aus3'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test-integration-upstream:
# The type of runner that the job will run on
runs-on: macos-latest
strategy:
matrix:
api-level: [29]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:

- name: Job run identifier ${{ github.event.inputs.id }}
run: |
if [ -z "${{ github.event.inputs.id }}" ]; then \
echo No job run identifier was set.
else
echo 'Job run identifier is:' ${{ inputs.id }}
fi;
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.branch }}

- name: Setup JAVA 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11

- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

- name: run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
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: make ci-upstream-integration-test EDGE_ENVIRONMENT=${{ github.event.inputs.environment }} EDGE_LOCATION_HINT=${{ github.event.inputs.edge-location-hint }}

# Potential workflow solutions on job failure
- name: On failure
if: ${{ failure() }}
run: |
echo 'Job used branch: ' ${{ github.event.inputs.branch }}. Please make sure this is the branch to run off of.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,6 @@ fastlane/readme.md

# .Idea file
code/.idea*

# VS Code
.vscode

0 comments on commit 2519205

Please sign in to comment.