Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge to Staging for v3.0.0 relase #119

Merged
merged 6 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
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
158 changes: 93 additions & 65 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
#
# Copyright 2021 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.
#

version: 2.1
orbs:
android: circleci/[email protected]
# Use the circleci android orb version that supports OpenJDK17 required by AGP 8.2+
android: circleci/[email protected]
codecov: codecov/[email protected]

parameters:
build_path:
type: string
default: "code/edgeidentity/build"

# Workflows orchestrate a set of jobs to be run;
workflows:
Expand All @@ -14,104 +33,113 @@ workflows:
- functional-test:
requires:
- validate-code

jobs:
validate-code:
working_directory: ~/code
docker:
- image: circleci/android:api-29-node
environment:
JVM_OPTS: -Xmx3200m
executor:
name: android/android-docker
resource-class: medium
tag: 2024.01.1-node

steps:
- checkout

- android/restore-gradle-cache

- android/restore-build-cache

- run:
name: Check Code Format
command: make format-check
name: Check Format
command: make checkformat

- run:
name: Lint
command: make lint

- android/save-gradle-cache

- android/save-build-cache

# Store Lint report
- store_artifacts:
path: << pipeline.parameters.build_path >>/reports

build-and-unit-test:
working_directory: ~/code
docker:
- image: circleci/android:api-29-node
environment:
JVM_OPTS: -Xmx3200m
executor:
name: android/android-docker
resource-class: medium
tag: 2024.01.1-node

steps:
- checkout

- android/restore-gradle-cache

- android/restore-build-cache

- run:
name: Javadoc
command: make ci-javadoc
command: make javadoc

- store_artifacts:
path: ci/javadoc/build/reports
path: << pipeline.parameters.build_path >>/docs/javadoc

- run:
name: Build
command: make ci-build

# - run:
# name: Build App
# command: make ci-build-app
name: Assemble Phone
command: make assemble-phone

- run:
name: UnitTests
command: make ci-unit-test
name: Assemble App
command: make assemble-app

# code coverage
- run:
name: Upload Code Coverage Report
command: |
curl -s https://codecov.io/bash > codecov;
VERSION=$(grep 'VERSION=\"[0-9\.]*\"' codecov | cut -d'"' -f2);
SHAVERSION=$(shasum -v);
echo "Using CodeCov version '$VERSION'"
echo "Using shasum '$SHAVERSION'"
for i in 1 256 512
do
shasum -a $i -c --ignore-missing <(curl -s "https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA${i}SUM") ||
shasum -a $i -c <(curl -s "https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA${i}SUM" | grep -w "codecov")
done
bash ./codecov -v -X s3 -c -D "./ci/unit-test/build/reports" -F unit-tests
- android/run-tests:
test-command: make unit-test-coverage

- store_artifacts:
path: ci/unit-test/build/reports
path: << pipeline.parameters.build_path >>/reports/tests

- store_test_results:
path: ci/unit-test/build/test-results
path: << pipeline.parameters.build_path >>/test-results/testPhoneDebugUnitTest

- android/save-gradle-cache

- android/save-build-cache

- codecov/upload:
file: << pipeline.parameters.build_path >>/reports/coverage/test/phone/debug/report.xml
flags: unit-tests

functional-test:
executor:
executor:
name: android/android-machine
resource-class: large
resource-class: medium
tag: 2024.01.1

steps:
- checkout

- android/restore-build-cache

- 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
post-emulator-launch-assemble-command: make assemble-phone
# The test command
test-command: make ci-functional-test

# code coverage
- run:
name: Upload Code Coverage Report
command: |
curl -s https://codecov.io/bash > codecov;
VERSION=$(grep 'VERSION=\"[0-9\.]*\"' codecov | cut -d'"' -f2);
SHAVERSION=$(shasum -v);
echo "Using CodeCov version '$VERSION'"
echo "Using shasum '$SHAVERSION'"
for i in 1 256 512
do
shasum -a $i -c --ignore-missing <(curl -s "https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA${i}SUM") ||
shasum -a $i -c <(curl -s "https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA${i}SUM" | grep -w "codecov")
done
bash ./codecov -v -X s3 -c -D "./ci/functional-test/build/reports" -F functional-tests
test-command: make functional-test-coverage

- android/save-build-cache

- codecov/upload:
file: << pipeline.parameters.build_path >>/reports/coverage/androidTest/phone/debug/connected/report.xml
flags: functional-tests

- store_artifacts:
path: ci/functional-test/build/reports
path: << pipeline.parameters.build_path >>/reports/androidTests

- store_test_results:
path: ci/functional-test/build/outputs/androidTest-results


path: << pipeline.parameters.build_path >>/outputs/androidTest-results
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
#
# 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.
#

name: Bug report
description: Create a bug report to help us improve. Use this template if you encountered an issue while integrating with or implementing the APIs of this SDK.
labels: [bug, triage-required]
Expand Down
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
#
# 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.
#

name: Feature request
description: Suggest an idea for this project.
labels: [feature-request, triage-required]
Expand Down
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/project_epic.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
#
# 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.
#

name: Project epic
description: Create an internal epic that represents the top level parent of multiple tasks.
labels: [epic]
Expand Down
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/project_task.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
#
# 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.
#

name: Project task
description: Create an internal task that can be completed as a standalone code change or is part of an epic.
labels: [task]
Expand Down
16 changes: 16 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#
# Copyright 2024 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.
#

template: |
## What’s Changed

$CHANGES
62 changes: 52 additions & 10 deletions .github/workflows/maven-release.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,74 @@
name: Publish package to the Maven Central Repository
on:
push:
branches:
- main
#
# Copyright 2021 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.
#

name: Publish Release
on:
workflow_dispatch:
inputs:
tag:
description: 'tag/version'
required: true

action_tag:
description: 'Create tag? ("no" to skip)'
required: true
default: 'yes'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Java
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'zulu'
java-version: 17

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

- name: Verify version
run: |
set -eo pipefail
echo Release version: ${{ github.event.inputs.tag }}
(./scripts/version.sh -v ${{ github.event.inputs.tag }})

- name: Create GH Release
id: create_release
uses: release-drafter/release-drafter@v5
if: ${{ github.event.inputs.action_tag == 'yes' }}
with:
name: v${{ github.event.inputs.tag }}
tag: v${{ github.event.inputs.tag }}
version: v${{ github.event.inputs.tag }}
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Import GPG key
env:
GPG_SECRET_KEYS: ${{ secrets.GPG_SECRET_KEYS }}
GPG_OWNERTRUST: ${{ secrets.GPG_OWNERTRUST }}
run: |
echo $GPG_SECRET_KEYS | base64 --decode | gpg --import --no-tty --batch --yes
echo $GPG_OWNERTRUST | base64 --decode | gpg --import-ownertrust --no-tty --batch --yes
- name: Publish to maven central staging repository
run: make ci-publish-main

- name: Publish to Maven Central Repository
run: make ci-publish
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
Expand Down
Loading