Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: Run Functional Tests
name: Run tests on android emulator

on:
workflow_dispatch:
workflow_call:
schedule:
- cron: '0 3 * * *'
pull_request:
branches: [ main ]

Expand Down Expand Up @@ -62,7 +60,7 @@ jobs:
disable-animations: false
script: echo "Generated AVD snapshot for caching."

- name: Run Functional Tests
- name: Run tests on android emulator
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
Expand All @@ -77,20 +75,8 @@ jobs:
if: always()
uses: actions/upload-artifact@v4
with:
name: sdk-functional-test-results
name: android-emulator-test-results
path: |
embrace-android-sdk/build/reports/androidTests/connected
test_failure
emulator_logcat.log

- name: Notify Slack of Test Failure
if: failure()
uses: slackapi/slack-github-action@v1.27.0
with:
payload: |
{
"failed_action_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
4 changes: 2 additions & 2 deletions .github/workflows/build-example-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ concurrency:
cancel-in-progress: true

jobs:
gradle-test:
build-example-app:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
Expand All @@ -31,6 +31,6 @@ jobs:
uses: gradle/actions/setup-gradle@v4

# Build the entire project, run the tests, and run all static analysis
- name: Gradle Build
- name: Build example app
working-directory: examples/ExampleApp
run: ./gradlew bundleRelease
49 changes: 49 additions & 0 deletions .github/workflows/bump-snapshot-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Bump snapshot version

on:
workflow_call:
inputs:
next_version:
required: true
type: string
workflow_dispatch:
inputs:
next_version:
description: 'Next version. Specify <major.minor>, e.g. 6.4 (Do NOT include -SNAPSHOT, this will be added automatically)'
required: true

permissions:
contents: write
pull-requests: write

jobs:
bump-snapshot-version:
name: Bump snapshot version
timeout-minutes: 60
runs-on: ubuntu-latest
steps:

- name: Checkout SDK
uses: actions/checkout@v4

- name: Set next version
run: sed -i -r "s#version=([^\']+)#version=${{ inputs.next_version }}.0-SNAPSHOT#" gradle.properties

- name: Create PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name 'embrace-ci[bot]'
git config --global user.email 'embrace-ci@users.noreply.github.com'

branch=sdk-version-update-${{ github.run_id }}
git checkout -b $branch

git add gradle.properties
git commit -m "CI/CD: set next version: ${{ inputs.next_version }}.0-SNAPSHOT"
git push -f origin $branch
gh pr create \
--base main \
--head $branch \
--title "CI/CD: set next version: ${{ inputs.next_version }}.0-SNAPSHOT" \
--body "This is an autogenerated PR, created by the bump-snapshot-version.yml workflow"
8 changes: 4 additions & 4 deletions .github/workflows/ci-gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:
jobs:
gradle-test:
runs-on: ubuntu-latest
timeout-minutes: 30
timeout-minutes: 60
steps:
- name: Checkout Branch
uses: actions/checkout@v4
Expand Down Expand Up @@ -43,14 +43,14 @@ jobs:

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

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

- name: Run Kover Code Coverage
run: ./gradlew koverXmlReportRelease
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/create-release-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Create Release Branch

on:
workflow_call:
inputs:
rc_version:
required: true
type: string
workflow_dispatch:
inputs:
rc_version:
description: 'Version to release. Specify <major.minor.patch>, e.g. 7.1.2. A new branch called "release/<version>" will be created where the release-specific changes will be committed.'
required: true

permissions:
contents: write

jobs:
create-release-branch:
name: Create Release Branch
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- name: Configure git
run: |
git config --global user.name 'embrace-ci[bot]'
git config --global user.email 'embrace-ci@users.noreply.github.com'

- name: Checkout
uses: actions/checkout@v4

- name: Create Release Branch "release/${{ inputs.rc_version }}"
run: |
git checkout -b release/${{ inputs.rc_version }}

- name: Set version in gradle.properties
run: |
sed -i -r "s#version = ([^\']+)#version=${{ inputs.rc_version }}#" gradle.properties
git add gradle.properties
git commit -m "CI/CD: change version to be released: ${{ inputs.rc_version }}"
git push --set-upstream origin release/${{ inputs.rc_version }}
66 changes: 0 additions & 66 deletions .github/workflows/embrace-gradle-plugin-tests.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,14 @@ jobs:
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Read SDK version
- name: Read version
run: |
# Read the version from gradle.properties
version=$(grep '^version' gradle.properties | cut -d'=' -f2 | tr -d '[:space:]')
# Set the version as an environment variable
echo "ANDROID_SDK_VERSION=${version}" >> "$GITHUB_ENV"

- name: Publish SDK to Maven local
run: ./gradlew pTML

- name: Checkout embrace gradle plugin
uses: actions/checkout@v4
with:
repository: embrace-io/embrace-swazzler3
token: ${{ secrets.GH_EMBRACE_SWAZZLER3_TOKEN }}
path: './embrace-swazzler3'

- name: Publish embrace gradle plugin to Maven local
working-directory: ./embrace-swazzler3
- name: Publish to Maven local
run: ./gradlew pTML

- name: Checkout Android SDK Benchmark
Expand All @@ -70,7 +59,7 @@ jobs:

- name: Generate Baseline Profile
working-directory: android-sdk-benchmark
run: ./gradlew -Pswazzler_version=${{ env.ANDROID_SDK_VERSION }} :macrobenchmark:pixel6Api34BaselineProfileAndroidTest
run: ./gradlew :macrobenchmark:pixel6Api34BaselineProfileAndroidTest
-Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=BaselineProfile
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"
-Pandroid.experimental.testOptions.managedDevices.maxConcurrentDevices=1
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/pre-release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,32 @@ name: Prepare New Release
on:
workflow_dispatch:
inputs:
version_to_release:
description: 'Version to release. Specify <major.minor> only, without the patch number, e.g. 6.3. A new branch called "release/<version>" will be created where the release-specific changes will be committed.'
rc_version:
description: 'Version to release. Specify <major.minor.patch> e.g. 7.1.2. A new branch called "release/<version>" will be created where the release-specific changes will be committed.'
required: true
next_version:
description: 'Next version. Specify <major.minor>, e.g. 6.4 (Do NOT include -SNAPSHOT, will be added automatically)'
description: 'Next version. Specify <major.minor.patch>, e.g. 7.2.0 (Do NOT include -SNAPSHOT, will be added automatically)'
required: true

jobs:
release-branch:
name: Create Release Branches
uses: ./.github/workflows/rc-release-branch.yml
create-release-branch:
name: Create Release Branch
uses: ./.github/workflows/create-release-branch.yml
secrets: inherit
with:
version_to_release: ${{ github.event.inputs.version_to_release }}
rc_version: ${{ inputs.rc_version }}

update-main-versions:
name: Update Main Versions
uses: ./.github/workflows/update-main-versions.yml
bump-snapshot-version:
name: Bump Snapshot Version
uses: ./.github/workflows/bump-snapshot-version.yml
secrets: inherit
with:
next_version: ${{ github.event.inputs.next_version }}
next_version: ${{ inputs.next_version }}

release-candidate:
name: Build Release Candidates
needs: release-branch
uses: ./.github/workflows/build-rc-workflow.yml
upload-artifacts-to-sonatype:
name: Upload RC artifacts to Sonatype
needs: create-release-branch
uses: ./.github/workflows/upload-artifacts-to-sonatype.yml
secrets: inherit
with:
version_of_rc: ${{ github.event.inputs.version_to_release }}
rc_version: ${{ inputs.rc_version }}
27 changes: 10 additions & 17 deletions .github/workflows/publish-api-docs.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
name: Publish API Docs
name: Publish API Docs to GitHub Pages

on:
workflow_call:
inputs:
version_to_release:
required: true
type: string
patch_version_of_release:
rc_version:
required: true
type: string
workflow_dispatch:
inputs:
version_to_release:
description: 'SDK version these docs are for. Specify <major.minor> only, without the patch number, e.g. 6.3. It will use the branch "release/<version>".'
required: true
patch_version_of_release:
description: 'The patch version for this release, i.e. the third number per semantic versioning <major.minor.patch>. If it is not a hotfix, use the default of 0'
rc_version:
description: 'SDK version these docs are for. Specify <major.minor.patch> e.g. 7.1.2. It will use the branch "release/<version>".'
required: true
default: '0'

permissions:
contents: write
Expand All @@ -35,7 +28,7 @@ jobs:
- name: Checkout SDK
uses: actions/checkout@v4
with:
ref: release/${{ github.event.inputs.version_to_release }}
ref: release/${{ inputs.rc_version }}
fetch-depth: 0

- name: Setup Java
Expand All @@ -50,21 +43,21 @@ jobs:
- name: Generate Documentation
run: ./gradlew dokkaHtmlMultiModule clean --no-build-cache --no-configuration-cache

- name: Publish gh-pages
- name: Publish GitHub Pages
run: |
mv build/dokka/htmlMultiModule .docs-newly-generated # new docs generated by previous step
git checkout gh-pages
git rm -rf docs # old docs on gh-pages branch
mv .docs-newly-generated docs
date > docs/version.txt
echo ${{ github.sha }} >> docs/version.txt
echo ${{ github.event.inputs.version_to_release }}.${{ github.event.inputs.patch_version_of_release }} >> docs/version.txt
echo ${{ inputs.rc_version }} >> docs/version.txt
git add -f docs
git config --global user.name "embrace-ci"
git config --global user.email "embrace-ci@users.noreply.github.com"
git commit --allow-empty --message 'CI/CD: Automatically generated documentation for ${{ github.event.inputs.version_to_release }}.${{ github.event.inputs.patch_version_of_release }}' docs/
git commit --allow-empty --message 'CI/CD: Automatically generated documentation for ${{ inputs.rc_version }}' docs/
git push --force origin gh-pages

- name: Record SDK Version History (${{ github.event.inputs.version_to_release }}.${{ github.event.inputs.patch_version_of_release }})
- name: Record Version History (${{ inputs.rc_version }})
run: |
curl -X POST ${{ vars.SDK_VERSION_URL }}/android/version/ -H 'X-Embrace-CI: ${{ secrets.SDK_VERSION_TOKEN }}' -H 'Content-Type: application/json' -d '{"version": "${{ github.event.inputs.version_to_release }}.${{ github.event.inputs.patch_version_of_release }}"}'
curl -X POST ${{ vars.SDK_VERSION_URL }}/android/version/ -H 'X-Embrace-CI: ${{ secrets.SDK_VERSION_TOKEN }}' -H 'Content-Type: application/json' -d '{"version": "${{ inputs.rc_version }}"}'
Loading