Skip to content

Commit

Permalink
first commit: 6.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsitoPuglisi committed Oct 13, 2023
0 parents commit 1c8e4ab
Show file tree
Hide file tree
Showing 1,035 changed files with 102,788 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# DevOps
.github @embrace-io/team-devops

# Global owners
* @embrace-io/sdk-android

# API surface owners
*.api @fractalwrench @fnewberg
**/Embrace.java @fractalwrench @fnewberg
**/EmbraceApi.java @fractalwrench @fnewberg
**/EmbraceAndroidApi.java @fractalwrench @fnewberg
**/EmbraceInternalInterface.java @fractalwrench @fnewberg
**/FlutterInternalInterface.java @fractalwrench @fnewberg
**/ReactNativeInternalInterface.java @fractalwrench @fnewberg
**/UnityInternalInterface.java @fractalwrench @fnewberg
16 changes: 16 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Goal

<!-- Describe what this change seeks to address -->

## Testing

<!-- Describe how this change has been tested -->

## Release Notes

<!-- Notes to add in the next Release. Ignore if the changes are internal. -->

**WHAT**:<br>
**WHY**:<br>
**WHO**:<br>

6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
11 changes: 11 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
changelog:
categories:
- title: Features
labels:
- '*'
exclude:
labels:
- dependencies
- title: Dependencies
labels:
- dependencies
84 changes: 84 additions & 0 deletions .github/workflows/ci-gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches:
release:
types: [ released ]

jobs:
gradle-test:
runs-on: ubuntu-22.04-4cores
strategy:
matrix:
jdk-version: ["11"]
ndk-version: ["21.4.7075529"]
steps:
- name: Checkout Branch
uses: actions/checkout@v3
with:
fetch-depth: 0

# EMB-11508 - See https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.m2/repository
~/.sonar/cache
key: ${{ runner.os }}-gradle-jdk${{ matrix.jdk-version }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle
- name: Install JDK ${{ matrix.jdk-version }}
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: ${{ matrix.jdk-version }}

- name: Setup NDK ${{ matrix.ndk-version }}
run: |
export ANDROID_ROOT=/usr/local/lib/android
export ANDROID_SDK_ROOT=${ANDROID_ROOT}/sdk
export ANDROID_NDK_ROOT=${ANDROID_SDK_ROOT}/ndk-bundle
ln -sfn $ANDROID_SDK_ROOT/ndk/${{ matrix.ndk-version }} $ANDROID_NDK_ROOT
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1

# Build the entire project, run the tests, and run all static analysis
- name: Gradle Build
run: ./gradlew assembleRelease check --stacktrace

- name: Archive Test Results
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: android-sdk-test-results
path: embrace-android-sdk/build/reports/tests/

- name: Run Kover Code Coverage
run: ./gradlew clean koverXmlReportRelease

- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
file: embrace-android-sdk/build/reports/kover/reportRelease.xml

- name: Cleanup Gradle Cache
# Based on https://docs.github.com/en/actions/guides/building-and-testing-java-with-gradle#caching-dependencies
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties
128 changes: 128 additions & 0 deletions .github/workflows/functional-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: Run Functional Tests

on:
workflow_dispatch:
workflow_call:
secrets:
token:
required: true
schedule:
- cron: '0 3 * * *'
pull_request:
branches: [ master ]

env:
ANDROID_EMULATOR_WAIT_TIME_BEFORE_KILL: 60

jobs:
test:
runs-on: macos-latest
strategy:
matrix:
jdk-version: ["11"]
ndk-version: ["21.4.7075529"]
api-level: [29]
target: [default]

steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.CD_GITHUB_TOKEN || secrets.token }}
fetch-depth: 0

- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.m2/repository
~/.sonar/cache
key: ${{ runner.os }}-gradle-jdk${{ matrix.jdk-version }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle
# Cache the emulator
- name: AVD cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}

- name: create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: embrace-io/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
force-avd-creation: false
disable-animations: false
script: echo "Generated AVD snapshot for caching."

- name: Install JDK ${{ matrix.jdk-version }}
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: ${{ matrix.jdk-version }}

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: Run Functional Tests
uses: embrace-io/android-emulator-runner@v2
id: runFunctionalTests1
continue-on-error: true
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: x86_64
profile: Nexus 6
# Grab the failures from the device so we can include them in results.
# Exit with non-zero so GH checks still fail.
script: ./gradlew connectedCheck --stacktrace || (adb pull /storage/emulated/0/Android/data/io.embrace.android.embracesdk.test/cache/test_failure/ && exit 127)

- name: Retry Functional Tests
uses: embrace-io/android-emulator-runner@v2
id: runFunctionalTests2
if: steps.runFunctionalTests1.outcome == 'failure'
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: x86_64
profile: Nexus 6
# Grab the failures from the device so we can include them in results.
# Exit with non-zero so GH checks still fail.
script: ./gradlew connectedCheck --stacktrace || (adb pull /storage/emulated/0/Android/data/io.embrace.android.embracesdk.test/cache/test_failure/ && exit 127)

- name: Archive Test Results
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: sdk-functional-test-results
path: |
embrace-android-sdk/build/reports/androidTests/connected
test_failure
- name: Post workflow result
id: slack
if: ${{steps.runFunctionalTests1.outcome == 'failure'}}
uses: slackapi/[email protected]
with:
payload: |
{
"functional_test_retried": "${{steps.runFunctionalTests1.outcome == 'failure'}}",
"workflow_failed": "${{steps.runFunctionalTests1.outcome == 'failure' && steps.runFunctionalTests2.outcome == 'failure'}}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

- name: Cleanup Gradle Cache
# Based on https://docs.github.com/en/actions/guides/building-and-testing-java-with-gradle#caching-dependencies
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties
12 changes: 12 additions & 0 deletions .github/workflows/measure-sdk-size.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Measure SDK Size

on:
workflow_dispatch:

jobs:
measure-sdk-size:
uses: embrace-io/android-size-measure/.github/workflows/analyze-sdk-size.yml@main
with:
sdk_version: '5.21.0'
token: ${{ secrets.CD_GITHUB_TOKEN }}

100 changes: 100 additions & 0 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Snapshot

env:
MAVEN_QA_USER: github
MAVEN_QA_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}

on:
workflow_dispatch:
schedule:
- cron: '0 3 * * *'

jobs:
functional:
name: Run Functional Tests
uses: ./.github/workflows/functional-tests.yml
secrets:
token: ${{ secrets.CD_GITHUB_TOKEN }}
# swazzlertests:
# uses: embrace-io/swazzler-test/.github/workflows/callable_swazzler_test.yml@master
# secrets:
# token: ${{ secrets.CD_GITHUB_TOKEN }}
# baseline-profile:
# name: Update Baseline Profile file
#todo
sdk:
name: Publish SDK to Maven Internal
needs: [functional] # swazzlertests, baseline-profile
runs-on: ubuntu-latest
strategy:
matrix:
jdk-version: ["11"]
ndk-version: ["21.4.7075529"]
steps:
- name: Checkout Branch
uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.m2/repository
~/.sonar/cache
key: ${{ runner.os }}-gradle-jdk${{ matrix.jdk-version }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle
- name: Install JDK ${{ matrix.jdk-version }}
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: ${{ matrix.jdk-version }}

- name: Setup NDK ${{ matrix.ndk-version }}
run: |
export ANDROID_ROOT=/usr/local/lib/android
export ANDROID_SDK_ROOT=${ANDROID_ROOT}/sdk
export ANDROID_NDK_ROOT=${ANDROID_SDK_ROOT}/ndk-bundle
ln -sfn $ANDROID_SDK_ROOT/ndk/${{ matrix.ndk-version }} $ANDROID_NDK_ROOT
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1

# Build the entire project, run the tests, and run all static analysis
- name: Gradle Build
run: ./gradlew assembleRelease check --stacktrace

- name: Archive Test Results
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: android-sdk-test-results
path: embrace-android-sdk/build/reports/tests/

- name: Gradlew Release to internal Maven
run: |
./gradlew clean publishReleasePublicationToSnapshotRepository --stacktrace
- name: Checkout Swazzler
uses: actions/checkout@v3
with:
repository: embrace-io/embrace-swazzler3
ref: master
path: ./embrace-swazzler3
token: ${{ secrets.CD_GITHUB_TOKEN }}

- name: Swazzler Release
run: |
cd ./embrace-swazzler3
./gradlew clean publishPluginMavenPublicationToSnapshotRepository --stacktrace
- name: Cleanup Gradle Cache
# Based on https://docs.github.com/en/actions/guides/building-and-testing-java-with-gradle#caching-dependencies
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties
Loading

0 comments on commit 1c8e4ab

Please sign in to comment.